diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/apds990x.c | 4 | ||||
-rw-r--r-- | drivers/misc/bh1770glc.c | 2 | ||||
-rw-r--r-- | drivers/misc/eeprom/at25.c | 34 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 4 | ||||
-rw-r--r-- | drivers/misc/mei/mei_dev.h | 4 | ||||
-rw-r--r-- | drivers/misc/mei/pci-me.c | 8 | ||||
-rw-r--r-- | drivers/misc/mei/pci-txe.c | 8 |
7 files changed, 26 insertions, 38 deletions
diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c index 868a30a1b417..3739ffa9cdf1 100644 --- a/drivers/misc/apds990x.c +++ b/drivers/misc/apds990x.c @@ -609,7 +609,7 @@ static int apds990x_detect(struct apds990x_chip *chip) return ret; } -#if defined(CONFIG_PM) || defined(CONFIG_PM_RUNTIME) +#ifdef CONFIG_PM static int apds990x_chip_on(struct apds990x_chip *chip) { int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), @@ -1237,7 +1237,7 @@ static int apds990x_resume(struct device *dev) } #endif -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int apds990x_runtime_suspend(struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c index 7b55f8a152d4..b756381b8250 100644 --- a/drivers/misc/bh1770glc.c +++ b/drivers/misc/bh1770glc.c @@ -1358,7 +1358,7 @@ static int bh1770_resume(struct device *dev) } #endif -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int bh1770_runtime_suspend(struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index 634f72929e12..0a1af93ec638 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -18,7 +18,7 @@ #include <linux/spi/spi.h> #include <linux/spi/eeprom.h> -#include <linux/of.h> +#include <linux/property.h> /* * NOTE: this is an *EEPROM* driver. The vagaries of product naming @@ -301,35 +301,33 @@ static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf, /*-------------------------------------------------------------------------*/ -static int at25_np_to_chip(struct device *dev, - struct device_node *np, - struct spi_eeprom *chip) +static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip) { u32 val; memset(chip, 0, sizeof(*chip)); - strncpy(chip->name, np->name, sizeof(chip->name)); + strncpy(chip->name, "at25", sizeof(chip->name)); - if (of_property_read_u32(np, "size", &val) == 0 || - of_property_read_u32(np, "at25,byte-len", &val) == 0) { + if (device_property_read_u32(dev, "size", &val) == 0 || + device_property_read_u32(dev, "at25,byte-len", &val) == 0) { chip->byte_len = val; } else { dev_err(dev, "Error: missing \"size\" property\n"); return -ENODEV; } - if (of_property_read_u32(np, "pagesize", &val) == 0 || - of_property_read_u32(np, "at25,page-size", &val) == 0) { + if (device_property_read_u32(dev, "pagesize", &val) == 0 || + device_property_read_u32(dev, "at25,page-size", &val) == 0) { chip->page_size = (u16)val; } else { dev_err(dev, "Error: missing \"pagesize\" property\n"); return -ENODEV; } - if (of_property_read_u32(np, "at25,addr-mode", &val) == 0) { + if (device_property_read_u32(dev, "at25,addr-mode", &val) == 0) { chip->flags = (u16)val; } else { - if (of_property_read_u32(np, "address-width", &val)) { + if (device_property_read_u32(dev, "address-width", &val)) { dev_err(dev, "Error: missing \"address-width\" property\n"); return -ENODEV; @@ -350,7 +348,7 @@ static int at25_np_to_chip(struct device *dev, val); return -ENODEV; } - if (of_find_property(np, "read-only", NULL)) + if (device_property_present(dev, "read-only")) chip->flags |= EE_READONLY; } return 0; @@ -360,21 +358,15 @@ static int at25_probe(struct spi_device *spi) { struct at25_data *at25 = NULL; struct spi_eeprom chip; - struct device_node *np = spi->dev.of_node; int err; int sr; int addrlen; /* Chip description */ if (!spi->dev.platform_data) { - if (np) { - err = at25_np_to_chip(&spi->dev, np, &chip); - if (err) - return err; - } else { - dev_err(&spi->dev, "Error: no chip description\n"); - return -ENODEV; - } + err = at25_fw_to_chip(&spi->dev, &chip); + if (err) + return err; } else chip = *(struct spi_eeprom *)spi->dev.platform_data; diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index d324f8a97b88..63fe096d4462 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c @@ -235,7 +235,7 @@ static int lis3lv02d_i2c_resume(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int lis3_i2c_runtime_suspend(struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); @@ -253,7 +253,7 @@ static int lis3_i2c_runtime_resume(struct device *dev) lis3lv02d_poweron(lis3); return 0; } -#endif /* CONFIG_PM_RUNTIME */ +#endif /* CONFIG_PM */ static const struct i2c_device_id lis3lv02d_id[] = { {"lis3lv02d", LIS3LV02D}, diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 71744b16cc8c..61b04d7646f1 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h @@ -530,9 +530,9 @@ struct mei_device { * Power Gating support */ enum mei_pg_event pg_event; -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM struct dev_pm_domain pg_domain; -#endif /* CONFIG_PM_RUNTIME */ +#endif /* CONFIG_PM */ unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; u32 rd_msg_hdr; diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index f3225b1643ab..cf20d397068a 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c @@ -89,13 +89,13 @@ static const struct pci_device_id mei_me_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl); -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static inline void mei_me_set_pm_domain(struct mei_device *dev); static inline void mei_me_unset_pm_domain(struct mei_device *dev); #else static inline void mei_me_set_pm_domain(struct mei_device *dev) {} static inline void mei_me_unset_pm_domain(struct mei_device *dev) {} -#endif /* CONFIG_PM_RUNTIME */ +#endif /* CONFIG_PM */ /** * mei_me_quirk_probe - probe for devices that doesn't valid ME interface @@ -357,7 +357,7 @@ static int mei_me_pci_resume(struct device *device) } #endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int mei_me_pm_runtime_idle(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); @@ -453,9 +453,7 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev) /* stop using pm callbacks if any */ dev->dev->pm_domain = NULL; } -#endif /* CONFIG_PM_RUNTIME */ -#ifdef CONFIG_PM static const struct dev_pm_ops mei_me_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mei_me_pci_suspend, mei_me_pci_resume) diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c index bee1c6fb7e75..1f572deacf54 100644 --- a/drivers/misc/mei/pci-txe.c +++ b/drivers/misc/mei/pci-txe.c @@ -42,13 +42,13 @@ static const struct pci_device_id mei_txe_pci_tbl[] = { }; MODULE_DEVICE_TABLE(pci, mei_txe_pci_tbl); -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static inline void mei_txe_set_pm_domain(struct mei_device *dev); static inline void mei_txe_unset_pm_domain(struct mei_device *dev); #else static inline void mei_txe_set_pm_domain(struct mei_device *dev) {} static inline void mei_txe_unset_pm_domain(struct mei_device *dev) {} -#endif /* CONFIG_PM_RUNTIME */ +#endif /* CONFIG_PM */ static void mei_txe_pci_iounmap(struct pci_dev *pdev, struct mei_txe_hw *hw) { @@ -295,7 +295,7 @@ static int mei_txe_pci_resume(struct device *device) } #endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int mei_txe_pm_runtime_idle(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); @@ -401,9 +401,7 @@ static inline void mei_txe_unset_pm_domain(struct mei_device *dev) /* stop using pm callbacks if any */ dev->dev->pm_domain = NULL; } -#endif /* CONFIG_PM_RUNTIME */ -#ifdef CONFIG_PM static const struct dev_pm_ops mei_txe_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mei_txe_pci_suspend, mei_txe_pci_resume) |