Skip to content

Commit 4f7ad52

Browse files
committed
SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
After commit b2b49cc (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under drivers/scsi/ and in include/scsi/scsi_device.h. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com> Acked-by: Christoph Hellwig <hch@lst.de>
1 parent 798bc6d commit 4f7ad52

5 files changed

Lines changed: 12 additions & 29 deletions

File tree

‎drivers/scsi/scsi_pm.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ static int scsi_bus_restore(struct device *dev)
213213

214214
#endif /* CONFIG_PM_SLEEP */
215215

216-
#ifdef CONFIG_PM_RUNTIME
217-
218216
static int sdev_runtime_suspend(struct device *dev)
219217
{
220218
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)
332330
pm_runtime_put_sync(&shost->shost_gendev);
333331
}
334332

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-
343333
const struct dev_pm_ops scsi_bus_pm_ops = {
344334
.prepare = scsi_bus_prepare,
345335
.suspend = scsi_bus_suspend,

‎drivers/scsi/scsi_priv.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ static inline void scsi_netlink_exit(void) {}
155155
/* scsi_pm.c */
156156
#ifdef CONFIG_PM
157157
extern const struct dev_pm_ops scsi_bus_pm_ops;
158-
#endif
159-
#ifdef CONFIG_PM_RUNTIME
158+
160159
extern void scsi_autopm_get_target(struct scsi_target *);
161160
extern void scsi_autopm_put_target(struct scsi_target *);
162161
extern int scsi_autopm_get_host(struct Scsi_Host *);
@@ -166,7 +165,7 @@ static inline void scsi_autopm_get_target(struct scsi_target *t) {}
166165
static inline void scsi_autopm_put_target(struct scsi_target *t) {}
167166
static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; }
168167
static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
169-
#endif /* CONFIG_PM_RUNTIME */
168+
#endif /* CONFIG_PM */
170169

171170
extern struct async_domain scsi_sd_pm_domain;
172171
extern struct async_domain scsi_sd_probe_domain;

‎drivers/scsi/ufs/ufshcd-pci.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ static int ufshcd_pci_resume(struct device *dev)
6262
{
6363
return ufshcd_system_resume(dev_get_drvdata(dev));
6464
}
65-
#else
66-
#define ufshcd_pci_suspend NULL
67-
#define ufshcd_pci_resume NULL
68-
#endif /* CONFIG_PM */
6965

70-
#ifdef CONFIG_PM_RUNTIME
7166
static int ufshcd_pci_runtime_suspend(struct device *dev)
7267
{
7368
return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -80,11 +75,13 @@ static int ufshcd_pci_runtime_idle(struct device *dev)
8075
{
8176
return ufshcd_runtime_idle(dev_get_drvdata(dev));
8277
}
83-
#else /* !CONFIG_PM_RUNTIME */
78+
#else /* !CONFIG_PM */
79+
#define ufshcd_pci_suspend NULL
80+
#define ufshcd_pci_resume NULL
8481
#define ufshcd_pci_runtime_suspend NULL
8582
#define ufshcd_pci_runtime_resume NULL
8683
#define ufshcd_pci_runtime_idle NULL
87-
#endif /* CONFIG_PM_RUNTIME */
84+
#endif /* CONFIG_PM */
8885

8986
/**
9087
* ufshcd_pci_shutdown - main function to put the controller in reset state

‎drivers/scsi/ufs/ufshcd-pltfrm.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,7 @@ static int ufshcd_pltfrm_resume(struct device *dev)
261261
{
262262
return ufshcd_system_resume(dev_get_drvdata(dev));
263263
}
264-
#else
265-
#define ufshcd_pltfrm_suspend NULL
266-
#define ufshcd_pltfrm_resume NULL
267-
#endif
268264

269-
#ifdef CONFIG_PM_RUNTIME
270265
static int ufshcd_pltfrm_runtime_suspend(struct device *dev)
271266
{
272267
return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -279,11 +274,13 @@ static int ufshcd_pltfrm_runtime_idle(struct device *dev)
279274
{
280275
return ufshcd_runtime_idle(dev_get_drvdata(dev));
281276
}
282-
#else /* !CONFIG_PM_RUNTIME */
277+
#else /* !CONFIG_PM */
278+
#define ufshcd_pltfrm_suspend NULL
279+
#define ufshcd_pltfrm_resume NULL
283280
#define ufshcd_pltfrm_runtime_suspend NULL
284281
#define ufshcd_pltfrm_runtime_resume NULL
285282
#define ufshcd_pltfrm_runtime_idle NULL
286-
#endif /* CONFIG_PM_RUNTIME */
283+
#endif /* CONFIG_PM */
287284

288285
static void ufshcd_pltfrm_shutdown(struct platform_device *pdev)
289286
{

‎include/scsi/scsi_device.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,13 @@ static inline int scsi_execute_req(struct scsi_device *sdev,
441441
extern void sdev_disable_disk_events(struct scsi_device *sdev);
442442
extern void sdev_enable_disk_events(struct scsi_device *sdev);
443443

444-
#ifdef CONFIG_PM_RUNTIME
444+
#ifdef CONFIG_PM
445445
extern int scsi_autopm_get_device(struct scsi_device *);
446446
extern void scsi_autopm_put_device(struct scsi_device *);
447447
#else
448448
static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; }
449449
static inline void scsi_autopm_put_device(struct scsi_device *d) {}
450-
#endif /* CONFIG_PM_RUNTIME */
450+
#endif /* CONFIG_PM */
451451

452452
static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
453453
{

0 commit comments

Comments
 (0)