diff options
| -rw-r--r-- | drivers/scsi/scsi_pm.c | 10 | ||||
| -rw-r--r-- | drivers/scsi/scsi_priv.h | 5 | ||||
| -rw-r--r-- | drivers/scsi/ufs/ufshcd-pci.c | 11 | ||||
| -rw-r--r-- | drivers/scsi/ufs/ufshcd-pltfrm.c | 11 | ||||
| -rw-r--r-- | include/scsi/scsi_device.h | 4 |
5 files changed, 12 insertions, 29 deletions
diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index 7454498c4091..9e43ae1d2163 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c | |||
| @@ -213,8 +213,6 @@ static int scsi_bus_restore(struct device *dev) | |||
| 213 | 213 | ||
| 214 | #endif /* CONFIG_PM_SLEEP */ | 214 | #endif /* CONFIG_PM_SLEEP */ |
| 215 | 215 | ||
| 216 | #ifdef CONFIG_PM_RUNTIME | ||
| 217 | |||
| 218 | static int sdev_runtime_suspend(struct device *dev) | 216 | static int sdev_runtime_suspend(struct device *dev) |
| 219 | { | 217 | { |
| 220 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 218 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
| @@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Host *shost) | |||
| 332 | pm_runtime_put_sync(&shost->shost_gendev); | 330 | pm_runtime_put_sync(&shost->shost_gendev); |
| 333 | } | 331 | } |
| 334 | 332 | ||
| 335 | #else | ||
| 336 | |||
| 337 | #define scsi_runtime_suspend NULL | ||
| 338 | #define scsi_runtime_resume NULL | ||
| 339 | #define scsi_runtime_idle NULL | ||
| 340 | |||
| 341 | #endif /* CONFIG_PM_RUNTIME */ | ||
| 342 | |||
| 343 | const struct dev_pm_ops scsi_bus_pm_ops = { | 333 | const struct dev_pm_ops scsi_bus_pm_ops = { |
| 344 | .prepare = scsi_bus_prepare, | 334 | .prepare = scsi_bus_prepare, |
| 345 | .suspend = scsi_bus_suspend, | 335 | .suspend = scsi_bus_suspend, |
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 2dc4a83fb84c..e3902fc66278 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h | |||
| @@ -155,8 +155,7 @@ static inline void scsi_netlink_exit(void) {} | |||
| 155 | /* scsi_pm.c */ | 155 | /* scsi_pm.c */ |
| 156 | #ifdef CONFIG_PM | 156 | #ifdef CONFIG_PM |
| 157 | extern const struct dev_pm_ops scsi_bus_pm_ops; | 157 | extern const struct dev_pm_ops scsi_bus_pm_ops; |
| 158 | #endif | 158 | |
| 159 | #ifdef CONFIG_PM_RUNTIME | ||
| 160 | extern void scsi_autopm_get_target(struct scsi_target *); | 159 | extern void scsi_autopm_get_target(struct scsi_target *); |
| 161 | extern void scsi_autopm_put_target(struct scsi_target *); | 160 | extern void scsi_autopm_put_target(struct scsi_target *); |
| 162 | extern int scsi_autopm_get_host(struct Scsi_Host *); | 161 | extern int scsi_autopm_get_host(struct Scsi_Host *); |
| @@ -166,7 +165,7 @@ static inline void scsi_autopm_get_target(struct scsi_target *t) {} | |||
| 166 | static inline void scsi_autopm_put_target(struct scsi_target *t) {} | 165 | static inline void scsi_autopm_put_target(struct scsi_target *t) {} |
| 167 | static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; } | 166 | static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; } |
| 168 | static inline void scsi_autopm_put_host(struct Scsi_Host *h) {} | 167 | static inline void scsi_autopm_put_host(struct Scsi_Host *h) {} |
| 169 | #endif /* CONFIG_PM_RUNTIME */ | 168 | #endif /* CONFIG_PM */ |
| 170 | 169 | ||
| 171 | extern struct async_domain scsi_sd_pm_domain; | 170 | extern struct async_domain scsi_sd_pm_domain; |
| 172 | extern struct async_domain scsi_sd_probe_domain; | 171 | extern struct async_domain scsi_sd_probe_domain; |
diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c index 955ed5587011..d15eaa466c59 100644 --- a/drivers/scsi/ufs/ufshcd-pci.c +++ b/drivers/scsi/ufs/ufshcd-pci.c | |||
| @@ -62,12 +62,7 @@ static int ufshcd_pci_resume(struct device *dev) | |||
| 62 | { | 62 | { |
| 63 | return ufshcd_system_resume(dev_get_drvdata(dev)); | 63 | return ufshcd_system_resume(dev_get_drvdata(dev)); |
| 64 | } | 64 | } |
| 65 | #else | ||
| 66 | #define ufshcd_pci_suspend NULL | ||
| 67 | #define ufshcd_pci_resume NULL | ||
| 68 | #endif /* CONFIG_PM */ | ||
| 69 | 65 | ||
| 70 | #ifdef CONFIG_PM_RUNTIME | ||
| 71 | static int ufshcd_pci_runtime_suspend(struct device *dev) | 66 | static int ufshcd_pci_runtime_suspend(struct device *dev) |
| 72 | { | 67 | { |
| 73 | return ufshcd_runtime_suspend(dev_get_drvdata(dev)); | 68 | return ufshcd_runtime_suspend(dev_get_drvdata(dev)); |
| @@ -80,11 +75,13 @@ static int ufshcd_pci_runtime_idle(struct device *dev) | |||
| 80 | { | 75 | { |
| 81 | return ufshcd_runtime_idle(dev_get_drvdata(dev)); | 76 | return ufshcd_runtime_idle(dev_get_drvdata(dev)); |
| 82 | } | 77 | } |
| 83 | #else /* !CONFIG_PM_RUNTIME */ | 78 | #else /* !CONFIG_PM */ |
| 79 | #define ufshcd_pci_suspend NULL | ||
| 80 | #define ufshcd_pci_resume NULL | ||
| 84 | #define ufshcd_pci_runtime_suspend NULL | 81 | #define ufshcd_pci_runtime_suspend NULL |
| 85 | #define ufshcd_pci_runtime_resume NULL | 82 | #define ufshcd_pci_runtime_resume NULL |
| 86 | #define ufshcd_pci_runtime_idle NULL | 83 | #define ufshcd_pci_runtime_idle NULL |
| 87 | #endif /* CONFIG_PM_RUNTIME */ | 84 | #endif /* CONFIG_PM */ |
| 88 | 85 | ||
| 89 | /** | 86 | /** |
| 90 | * ufshcd_pci_shutdown - main function to put the controller in reset state | 87 | * ufshcd_pci_shutdown - main function to put the controller in reset state |
diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 1c3467b82566..76d39b617db7 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c | |||
| @@ -261,12 +261,7 @@ static int ufshcd_pltfrm_resume(struct device *dev) | |||
| 261 | { | 261 | { |
| 262 | return ufshcd_system_resume(dev_get_drvdata(dev)); | 262 | return ufshcd_system_resume(dev_get_drvdata(dev)); |
| 263 | } | 263 | } |
| 264 | #else | ||
| 265 | #define ufshcd_pltfrm_suspend NULL | ||
| 266 | #define ufshcd_pltfrm_resume NULL | ||
| 267 | #endif | ||
| 268 | 264 | ||
| 269 | #ifdef CONFIG_PM_RUNTIME | ||
| 270 | static int ufshcd_pltfrm_runtime_suspend(struct device *dev) | 265 | static int ufshcd_pltfrm_runtime_suspend(struct device *dev) |
| 271 | { | 266 | { |
| 272 | return ufshcd_runtime_suspend(dev_get_drvdata(dev)); | 267 | return ufshcd_runtime_suspend(dev_get_drvdata(dev)); |
| @@ -279,11 +274,13 @@ static int ufshcd_pltfrm_runtime_idle(struct device *dev) | |||
| 279 | { | 274 | { |
| 280 | return ufshcd_runtime_idle(dev_get_drvdata(dev)); | 275 | return ufshcd_runtime_idle(dev_get_drvdata(dev)); |
| 281 | } | 276 | } |
| 282 | #else /* !CONFIG_PM_RUNTIME */ | 277 | #else /* !CONFIG_PM */ |
| 278 | #define ufshcd_pltfrm_suspend NULL | ||
| 279 | #define ufshcd_pltfrm_resume NULL | ||
| 283 | #define ufshcd_pltfrm_runtime_suspend NULL | 280 | #define ufshcd_pltfrm_runtime_suspend NULL |
| 284 | #define ufshcd_pltfrm_runtime_resume NULL | 281 | #define ufshcd_pltfrm_runtime_resume NULL |
| 285 | #define ufshcd_pltfrm_runtime_idle NULL | 282 | #define ufshcd_pltfrm_runtime_idle NULL |
| 286 | #endif /* CONFIG_PM_RUNTIME */ | 283 | #endif /* CONFIG_PM */ |
| 287 | 284 | ||
| 288 | static void ufshcd_pltfrm_shutdown(struct platform_device *pdev) | 285 | static void ufshcd_pltfrm_shutdown(struct platform_device *pdev) |
| 289 | { | 286 | { |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 6364e23454dd..3a4edd1f7dbb 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -441,13 +441,13 @@ static inline int scsi_execute_req(struct scsi_device *sdev, | |||
| 441 | extern void sdev_disable_disk_events(struct scsi_device *sdev); | 441 | extern void sdev_disable_disk_events(struct scsi_device *sdev); |
| 442 | extern void sdev_enable_disk_events(struct scsi_device *sdev); | 442 | extern void sdev_enable_disk_events(struct scsi_device *sdev); |
| 443 | 443 | ||
| 444 | #ifdef CONFIG_PM_RUNTIME | 444 | #ifdef CONFIG_PM |
| 445 | extern int scsi_autopm_get_device(struct scsi_device *); | 445 | extern int scsi_autopm_get_device(struct scsi_device *); |
| 446 | extern void scsi_autopm_put_device(struct scsi_device *); | 446 | extern void scsi_autopm_put_device(struct scsi_device *); |
| 447 | #else | 447 | #else |
| 448 | static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; } | 448 | static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; } |
| 449 | static inline void scsi_autopm_put_device(struct scsi_device *d) {} | 449 | static inline void scsi_autopm_put_device(struct scsi_device *d) {} |
| 450 | #endif /* CONFIG_PM_RUNTIME */ | 450 | #endif /* CONFIG_PM */ |
| 451 | 451 | ||
| 452 | static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev) | 452 | static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev) |
| 453 | { | 453 | { |
