virtio: Remove PM #ifdef guards to fix i2c driver

Message ID 20230801105846.3708252-1-arnd@kernel.org
State New
Headers
Series virtio: Remove PM #ifdef guards to fix i2c driver |

Commit Message

Arnd Bergmann Aug. 1, 2023, 10:58 a.m. UTC
  From: Arnd Bergmann <arnd@arndb.de>

A cleanup in the virtio i2c caused a build failure:

drivers/i2c/busses/i2c-virtio.c:270:10: error: 'struct virtio_driver' has no member named 'freeze'
drivers/i2c/busses/i2c-virtio.c:271:10: error: 'struct virtio_driver' has no member named 'restore'

Change the structure definition to allow this cleanup to
be applied everywhere.

Fixes: 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM related functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/virtio.h | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Andi Shyti Aug. 1, 2023, 10:20 p.m. UTC | #1
Hi Arnd,

On Tue, Aug 01, 2023 at 12:58:15PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A cleanup in the virtio i2c caused a build failure:
> 
> drivers/i2c/busses/i2c-virtio.c:270:10: error: 'struct virtio_driver' has no member named 'freeze'
> drivers/i2c/busses/i2c-virtio.c:271:10: error: 'struct virtio_driver' has no member named 'restore'
> 
> Change the structure definition to allow this cleanup to
> be applied everywhere.
> 
> Fixes: 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM related functions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/linux/virtio.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> index 0f3b9017dff40..9b94e2c9bbb81 100644
> --- a/include/linux/virtio.h
> +++ b/include/linux/virtio.h
> @@ -218,10 +218,8 @@ struct virtio_driver {
>  	void (*scan)(struct virtio_device *dev);
>  	void (*remove)(struct virtio_device *dev);
>  	void (*config_changed)(struct virtio_device *dev);
> -#ifdef CONFIG_PM
>  	int (*freeze)(struct virtio_device *dev);
>  	int (*restore)(struct virtio_device *dev);
> -#endif

oh yes! Thank you!

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi
  
Paul Cercueil Aug. 1, 2023, 11:06 p.m. UTC | #2
Hi,

Le mardi 01 août 2023 à 12:58 +0200, Arnd Bergmann a écrit :
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A cleanup in the virtio i2c caused a build failure:
> 
> drivers/i2c/busses/i2c-virtio.c:270:10: error: 'struct virtio_driver'
> has no member named 'freeze'
> drivers/i2c/busses/i2c-virtio.c:271:10: error: 'struct virtio_driver'
> has no member named 'restore'
> 
> Change the structure definition to allow this cleanup to
> be applied everywhere.
> 
> Fixes: 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM
> related functions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks, I didn't realize it was merged already.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  include/linux/virtio.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> index 0f3b9017dff40..9b94e2c9bbb81 100644
> --- a/include/linux/virtio.h
> +++ b/include/linux/virtio.h
> @@ -218,10 +218,8 @@ struct virtio_driver {
>         void (*scan)(struct virtio_device *dev);
>         void (*remove)(struct virtio_device *dev);
>         void (*config_changed)(struct virtio_device *dev);
> -#ifdef CONFIG_PM
>         int (*freeze)(struct virtio_device *dev);
>         int (*restore)(struct virtio_device *dev);
> -#endif
>  };
>  
>  static inline struct virtio_driver *drv_to_virtio(struct
> device_driver *drv)
  
Andi Shyti Aug. 1, 2023, 11:42 p.m. UTC | #3
Hi,

On Wed, Aug 02, 2023 at 01:06:47AM +0200, Paul Cercueil wrote:
> Hi,
> 
> Le mardi 01 août 2023 à 12:58 +0200, Arnd Bergmann a écrit :
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > A cleanup in the virtio i2c caused a build failure:
> > 
> > drivers/i2c/busses/i2c-virtio.c:270:10: error: 'struct virtio_driver'
> > has no member named 'freeze'
> > drivers/i2c/busses/i2c-virtio.c:271:10: error: 'struct virtio_driver'
> > has no member named 'restore'
> > 
> > Change the structure definition to allow this cleanup to
> > be applied everywhere.
> > 
> > Fixes: 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM
> > related functions")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Thanks, I didn't realize it was merged already.
> 
> Reviewed-by: Paul Cercueil <paul@crapouillou.net>

Actually this fix is taken from linux-next, it's not in
Wolfram's branch, it's in mine. I can still force-push a fixed
version in Paul's original patch in order to avoid breaking the
bisectability.

Andi
  
Andi Shyti Aug. 2, 2023, 8:10 p.m. UTC | #4
Hi

On Tue, 01 Aug 2023 12:58:15 +0200, Arnd Bergmann wrote:
> A cleanup in the virtio i2c caused a build failure:
> 
> drivers/i2c/busses/i2c-virtio.c:270:10: error: 'struct virtio_driver' has no member named 'freeze'
> drivers/i2c/busses/i2c-virtio.c:271:10: error: 'struct virtio_driver' has no member named 'restore'
> 
> Change the structure definition to allow this cleanup to
> be applied everywhere.
> 
> [...]

Applied to i2c/andi-for-next on

https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

Please note that this patch may still undergo further evaluation
and the final decision will be made in collaboration with
Wolfram.

Thank you,
Andi

Patches applied
===============
[1/1] virtio: Remove PM #ifdef guards to fix i2c driver
      commit: 37097e6ffd22bb9ec0d87dfe5c6c3eec4d5b5421
  

Patch

diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 0f3b9017dff40..9b94e2c9bbb81 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -218,10 +218,8 @@  struct virtio_driver {
 	void (*scan)(struct virtio_device *dev);
 	void (*remove)(struct virtio_device *dev);
 	void (*config_changed)(struct virtio_device *dev);
-#ifdef CONFIG_PM
 	int (*freeze)(struct virtio_device *dev);
 	int (*restore)(struct virtio_device *dev);
-#endif
 };
 
 static inline struct virtio_driver *drv_to_virtio(struct device_driver *drv)