Skip to contentSkip to conversation

virtio: Remove PM #ifdef guards to fix i2c driver

PATCH Applied Arnd Bergmann 3 participants 5 messages Aug 1, 2023 – Aug 2, 2023 virtio core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio: Remove PM #ifdef guards to fix i2c driver

From: Arnd Bergmann <[email protected]>

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")
---
 include/linux/virtio.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/virtio.h +0 -2
index 0f3b9017dff40..9b94e2c9bbb81 100644
@@ -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)
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Arnd,

Quoted 21 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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")
---
 include/linux/virtio.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/virtio.h +0 -0
index 0f3b9017dff40..9b94e2c9bbb81 100644

include/linux/virtio.h struct virtio_driver { · line 224

Quoted 7 lines
include/linux/virtio.h +0 -2
@@ -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!

Andi

Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann

Hi,

Le mardi 01 août 2023 à 12:58 +0200, Arnd Bergmann a écrit :

Quoted 9 lines

From: Arnd Bergmann <[email protected]>

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'

Quoted 6 lines

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

Fixes 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM

related functions")

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

Cheers,
-Paul

Quoted 20 lines

---
 include/linux/virtio.h | 2 --

 1 file changed, 2 deletions(-)
include/linux/virtio.h +0 -2
index 0f3b9017dff40..9b94e2c9bbb81 100644
@@ -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)

#3 lore raw

Hi,

Quoted 15 lines · Paul Cercueil

Hi,

Le mardi 01 août 2023 à 12:58 +0200, Arnd Bergmann a écrit :

Quoted 12 lines

From: Arnd Bergmann <[email protected]>

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.

Quoted 7 lines
Quoted 3 lines
Fixes 73d546c76235b ("i2c: virtio: Remove #ifdef guards for PM

related functions")

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

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

Applied
#4 lore raw
In reply to Arnd Bergmann

Hi

Quoted 9 lines · Arnd Bergmann

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