From 6acf70f078ca42a63397b8b84bf6383b01303009 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Thu, 23 Apr 2009 22:31:52 +0800 Subject: driver core: firmware_class: replace kfree(dev) with put_device(dev) against v2.6.30-rc3-next tree. Signed-off-by: Ming Lei Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_class.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8a267c42762..2d296b7f703 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -356,7 +356,7 @@ static void fw_dev_release(struct device *dev) __free_page(fw_priv->pages[i]); kfree(fw_priv->pages); kfree(fw_priv); - kfree(dev); + put_device(dev); module_put(THIS_MODULE); } @@ -400,14 +400,16 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, retval = device_register(f_dev); if (retval) { dev_err(device, "%s: device_register failed\n", __func__); - goto error_kfree; + put_device(f_dev); + goto error_kfree1; } *dev_p = f_dev; return 0; error_kfree: - kfree(fw_priv); kfree(f_dev); +error_kfree1: + kfree(fw_priv); return retval; } -- cgit v1.2.3 From 309b7d60a345f402bec3cf9caadb53de4028e2aa Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Fri, 24 Apr 2009 14:57:00 +0200 Subject: driver core: add BUS_NOTIFY_UNBOUND_DRIVER event This patch adds a new bus notifier event which is emitted _after_ a device is removed from its driver. This event will be used by the dma-api debug code to check if a driver has released all dma allocations for that device. Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 742cbe6b042..efd00de183b 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -320,6 +320,10 @@ static void __device_release_driver(struct device *dev) devres_release_all(dev); dev->driver = NULL; klist_remove(&dev->p->knode_driver); + if (dev->bus) + blocking_notifier_call_chain(&dev->bus->p->bus_notifier, + BUS_NOTIFY_UNBOUND_DRIVER, + dev); } } -- cgit v1.2.3 From c0afe7ba5e71d8ab66bc42f90b3e237581d3c509 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 27 Apr 2009 02:38:16 +0200 Subject: driver core: Const-correct platform getbyname functions This converts resource and IRQ getbyname functions for the platform bus to use const char *, I ran into compiler moanings when I tried using a const char * for looking up a certain resource. Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/base/platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ead3f64c41d..59df6290951 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -69,7 +69,8 @@ EXPORT_SYMBOL_GPL(platform_get_irq); * @name: resource name */ struct resource *platform_get_resource_byname(struct platform_device *dev, - unsigned int type, char *name) + unsigned int type, + const char *name) { int i; @@ -88,7 +89,7 @@ EXPORT_SYMBOL_GPL(platform_get_resource_byname); * @dev: platform device * @name: IRQ name */ -int platform_get_irq_byname(struct platform_device *dev, char *name) +int platform_get_irq_byname(struct platform_device *dev, const char *name) { struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); -- cgit v1.2.3 From 59a3cd7f9da60ac4ba8ae5a4cddc48fe4a450129 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 5 May 2009 20:38:28 -0700 Subject: Driver core: fix comment for device_attach() We are looking for matching drivers, not devices. Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/base/dd.c b/drivers/base/dd.c index efd00de183b..f0106875f01 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -226,7 +226,7 @@ static int __device_attach(struct device_driver *drv, void *data) * pair is found, break out and return. * * Returns 1 if the device was bound to a driver; - * 0 if no matching device was found; + * 0 if no matching driver was found; * -ENODEV if the device is not registered. * * When called for a USB interface, @dev->parent->sem must be held. -- cgit v1.2.3 From 9227c47bbdd87f276e08ed17877cc1649f5ed10a Mon Sep 17 00:00:00 2001 From: Dave Young Date: Mon, 11 May 2009 14:18:55 +0800 Subject: driver-core: make sysdev_class_register check kobject_set_name return value sysdev_class_register should check the kobject_set_name return value. Add the return value checking code. Signed-off-by: Dave Young Signed-off-by: Greg Kroah-Hartman --- drivers/base/sys.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9742a78c9fe..162355cd745 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -131,6 +131,8 @@ static struct kset *system_kset; int sysdev_class_register(struct sysdev_class *cls) { + int retval; + pr_debug("Registering sysdev class '%s'\n", cls->name); INIT_LIST_HEAD(&cls->drivers); @@ -138,7 +140,11 @@ int sysdev_class_register(struct sysdev_class *cls) cls->kset.kobj.parent = &system_kset->kobj; cls->kset.kobj.ktype = &ktype_sysdev_class; cls->kset.kobj.kset = system_kset; - kobject_set_name(&cls->kset.kobj, cls->name); + + retval = kobject_set_name(&cls->kset.kobj, cls->name); + if (retval) + return retval; + return kset_register(&cls->kset); } -- cgit v1.2.3 From 401097ea4b89846d66ac78f7f108d49c2e922d9c Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Tue, 12 May 2009 13:37:57 -0700 Subject: driver core: synchronize device shutdown A patch series to make .shutdown execute asynchronously. Some drivers's shutdown can take a lot of time. The patches can help save some shutdown time. The patches use Arjan's async API. This patch: synchronize all tasks submitted by .shutdown Signed-off-by: Shaohua Li Cc: Arjan van de Ven Cc: Dmitry Torokhov Cc: James Bottomley Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/base/core.c b/drivers/base/core.c index 1977d4beb89..7e8576d7822 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "base.h" #include "power/power.h" @@ -1665,4 +1666,5 @@ void device_shutdown(void) kobject_put(sysfs_dev_char_kobj); kobject_put(sysfs_dev_block_kobj); kobject_put(dev_kobj); + async_synchronize_full(); } -- cgit v1.2.3 From 7fcab099795812a8a08eb3b8c8ddb35c3685045f Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Fri, 29 May 2009 11:33:19 +0800 Subject: driver core: fix documentation of request_firmware_nowait request_firmware_nowait declares it can be called in non-sleep contexts, but kthead_run called by request_firmware_nowait may sleep. So fix its documentation and comment to make callers clear about it. Signed-off-by: Ming Lei Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_class.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 2d296b7f703..24277025058 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -617,8 +617,9 @@ request_firmware_work_func(void *arg) * @cont: function will be called asynchronously when the firmware * request is over. * - * Asynchronous variant of request_firmware() for contexts where - * it is not possible to sleep. + * Asynchronous variant of request_firmware() for user contexts where + * it is not possible to sleep for long time. It can't be called + * in atomic contexts. **/ int request_firmware_nowait( -- cgit v1.2.3 From 976821d756c53b421d7c58a9ed60125016d330aa Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 27 May 2009 00:49:31 +0200 Subject: firmware: allocate firmware id dynamically The firmware loader has a statically allocated 30 bytes long string for the firmware id (a.k.a. the firmware file name). There is no reason why we couldnt allocate it dynamically, and avoid having restrictions on the firmware names lengths. Signed-off-by: Samuel Ortiz Cc: Marcel Holtmann Cc: Zhu Yi , Cc: John Linville Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_class.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 24277025058..3591ba7ff6f 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -40,7 +40,7 @@ static int loading_timeout = 60; /* In seconds */ static DEFINE_MUTEX(fw_lock); struct firmware_priv { - char fw_id[FIRMWARE_NAME_MAX]; + char *fw_id; struct completion completion; struct bin_attribute attr_data; struct firmware *fw; @@ -355,6 +355,7 @@ static void fw_dev_release(struct device *dev) for (i = 0; i < fw_priv->nr_pages; i++) __free_page(fw_priv->pages[i]); kfree(fw_priv->pages); + kfree(fw_priv->fw_id); kfree(fw_priv); put_device(dev); @@ -386,7 +387,13 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, init_completion(&fw_priv->completion); fw_priv->attr_data = firmware_attr_data_tmpl; - strlcpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); + fw_priv->fw_id = kstrdup(fw_name, GFP_KERNEL); + if (!fw_priv->fw_id) { + dev_err(device, "%s: Firmware name allocation failed\n", + __func__); + retval = -ENOMEM; + goto error_kfree; + } fw_priv->timeout.function = firmware_class_timeout; fw_priv->timeout.data = (u_long) fw_priv; @@ -401,14 +408,15 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, if (retval) { dev_err(device, "%s: device_register failed\n", __func__); put_device(f_dev); - goto error_kfree1; + goto error_kfree_fw_id; } *dev_p = f_dev; return 0; +error_kfree_fw_id: + kfree(fw_priv->fw_id); error_kfree: kfree(f_dev); -error_kfree1: kfree(fw_priv); return retval; } -- cgit v1.2.3 From ade901d7a46e389197f028d12fb67d88f34cd8d5 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 27 May 2009 00:49:32 +0200 Subject: firmware: atm/ueagle-atm: prepare for FIRMWARE_NAME_MAX removal We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any firmware name length restriction. This patch replaces the shared FIRMWARE_NAME_MAX definition with a ueagle local one. Signed-off-by: Samuel Ortiz Cc: Damien Bergamini Signed-off-by: Greg Kroah-Hartman --- drivers/usb/atm/ueagle-atm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 9cf9ff69e3e..d171b563e94 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c @@ -306,6 +306,7 @@ enum { #define FW_GET_BYTE(p) *((__u8 *) (p)) #define FW_DIR "ueagle-atm/" +#define UEA_FW_NAME_MAX 30 #define NB_MODEM 4 #define BULK_TIMEOUT 300 @@ -1564,9 +1565,9 @@ static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver) file = cmv_file[sc->modem_index]; strcpy(cmv_name, FW_DIR); - strlcat(cmv_name, file, FIRMWARE_NAME_MAX); + strlcat(cmv_name, file, UEA_FW_NAME_MAX); if (ver == 2) - strlcat(cmv_name, ".v2", FIRMWARE_NAME_MAX); + strlcat(cmv_name, ".v2", UEA_FW_NAME_MAX); } static int request_cmvs_old(struct uea_softc *sc, @@ -1574,7 +1575,7 @@ static int request_cmvs_old(struct uea_softc *sc, { int ret, size; u8 *data; - char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */ + char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */ cmvs_file_name(sc, cmv_name, 1); ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); @@ -1608,7 +1609,7 @@ static int request_cmvs(struct uea_softc *sc, int ret, size; u32 crc; u8 *data; - char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */ + char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */ cmvs_file_name(sc, cmv_name, 2); ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); -- cgit v1.2.3 From 4327b77ed7e73336069c441f91df58a251c77975 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 27 May 2009 00:49:33 +0200 Subject: firmware: tuners/xc2028: prepare for FIRMWARE_NAME_MAX removal We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any firmware name length restriction. This patch gets rid of the xc2028 FIRMWARE_NAME_MAX reference. Signed-off-by: Samuel Ortiz Cc: Mauro Carvalho Chehab Cc: Michel Ludwig Signed-off-by: Greg Kroah-Hartman --- drivers/media/common/tuners/tuner-xc2028.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c index 1adce9ff52c..7636c33bc1e 100644 --- a/drivers/media/common/tuners/tuner-xc2028.c +++ b/drivers/media/common/tuners/tuner-xc2028.c @@ -48,7 +48,7 @@ MODULE_PARM_DESC(audio_std, "NICAM/A\n" "NICAM/B\n"); -static char firmware_name[FIRMWARE_NAME_MAX]; +static char firmware_name[30]; module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0); MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the " "default firmware name\n"); -- cgit v1.2.3 From 56aec8d874e222f68baffbda33322c9be4cbf2ea Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 27 May 2009 00:49:34 +0200 Subject: firmware: dvb/dvb-usb: prepare for FIRMWARE_NAME_MAX removal We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any firmware name length restriction. This patch changes the dvb_usb_device_properties firmware field accordingly. Signed-off-by: Samuel Ortiz Reviewed-by: Michael Krufky Cc: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb/dvb-usb/dvb-usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 2d5352e54dc..b5157518a30 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -196,7 +196,7 @@ struct dvb_usb_device_properties { #define CYPRESS_FX2 3 int usb_ctrl; int (*download_firmware) (struct usb_device *, const struct firmware *); - const char firmware[FIRMWARE_NAME_MAX]; + const char *firmware; int no_reconnect; int size_of_priv; -- cgit v1.2.3 From ed62acec209fa7e104b9d7871c1e5307fab83bf0 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 27 May 2009 00:49:35 +0200 Subject: firmware: pcmcia/ds: prepare for FIRMWARE_NAME_MAX removal We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any firmware name length restriction. With the FIRMWARE_NAME_MAX removal, the ds.c reference becomes useless as we dont need to check for the firmware name length anymore. Signed-off-by: Samuel Ortiz Cc: Dominik Brodowski Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/ds.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'drivers') diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 47cab31ff6e..8f2bb01b098 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -828,7 +828,6 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) { struct pcmcia_socket *s = dev->socket; const struct firmware *fw; - char path[FIRMWARE_NAME_MAX]; int ret = -ENOMEM; int no_funcs; int old_funcs; @@ -839,16 +838,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); - if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) { - dev_printk(KERN_WARNING, &dev->dev, - "pcmcia: CIS filename is too long [%s]\n", - filename); - return -EINVAL; - } - - snprintf(path, sizeof(path), "%s", filename); - - if (request_firmware(&fw, path, &dev->dev) == 0) { + if (request_firmware(&fw, filename, &dev->dev) == 0) { if (fw->size >= CISTPL_MAX_CIS_SIZE) { ret = -EINVAL; dev_printk(KERN_ERR, &dev->dev, -- cgit v1.2.3 From cadeba315cc91ae1b57632e61b0cec3a4ed7088d Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Wed, 27 May 2009 00:49:36 +0200 Subject: firmware: wireless/libertas: prepare for FIRMWARE_NAME_MAX removal We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any firmware name length restriction. This patch eplaces the shared FIRMWARE_NAME_MAX definition with a libertas local one. Signed-off-by: John W. Linville Acked-by: Dan Williams Acked-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/libertas/if_spi.c | 8 ++++---- drivers/net/wireless/libertas/if_spi.h | 3 +++ drivers/net/wireless/libertas/if_usb.c | 8 ++------ 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index f8c2898d82b..06a46d7b3d6 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c @@ -43,8 +43,8 @@ struct if_spi_card { struct lbs_private *priv; struct libertas_spi_platform_data *pdata; - char helper_fw_name[FIRMWARE_NAME_MAX]; - char main_fw_name[FIRMWARE_NAME_MAX]; + char helper_fw_name[IF_SPI_FW_NAME_MAX]; + char main_fw_name[IF_SPI_FW_NAME_MAX]; /* The card ID and card revision, as reported by the hardware. */ u16 card_id; @@ -1019,9 +1019,9 @@ static int if_spi_calculate_fw_names(u16 card_id, lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); return -EAFNOSUPPORT; } - snprintf(helper_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d_hlp.bin", + snprintf(helper_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d_hlp.bin", chip_id_to_device_name[i].name); - snprintf(main_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d.bin", + snprintf(main_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d.bin", chip_id_to_device_name[i].name); return 0; } diff --git a/drivers/net/wireless/libertas/if_spi.h b/drivers/net/wireless/libertas/if_spi.h index 2103869cc5b..f87eec41084 100644 --- a/drivers/net/wireless/libertas/if_spi.h +++ b/drivers/net/wireless/libertas/if_spi.h @@ -22,6 +22,9 @@ #define IF_SPI_CMD_BUF_SIZE 2400 /***************** Firmware *****************/ + +#define IF_SPI_FW_NAME_MAX 30 + struct chip_ident { u16 chip_id; u16 name; diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index d649caebf08..1844c5adf6e 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -61,11 +61,9 @@ static ssize_t if_usb_firmware_set(struct device *dev, { struct lbs_private *priv = to_net_dev(dev)->ml_priv; struct if_usb_card *cardp = priv->card; - char fwname[FIRMWARE_NAME_MAX]; int ret; - sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ - ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_FW); + ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_FW); if (ret == 0) return count; @@ -88,11 +86,9 @@ static ssize_t if_usb_boot2_set(struct device *dev, { struct lbs_private *priv = to_net_dev(dev)->ml_priv; struct if_usb_card *cardp = priv->card; - char fwname[FIRMWARE_NAME_MAX]; int ret; - sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ - ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_BOOT2); + ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_BOOT2); if (ret == 0) return count; -- cgit v1.2.3 From acc0e90fbccbc6e4d48184cba0983ea044e131af Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 2 Jun 2009 15:39:55 -0700 Subject: driver core: fix gcc 4.3.3 warnings about string literals This removes the warning: format not a string literal and no format arguments warnings in the driver core that gcc 4.3.3 complains about. Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 4 ++-- drivers/base/firmware_class.c | 2 +- drivers/base/platform.c | 2 +- drivers/base/sys.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/base/core.c b/drivers/base/core.c index 7e8576d7822..4d59975c24a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -875,7 +875,7 @@ int device_add(struct device *dev) * the name, and force the use of dev_name() */ if (dev->init_name) { - dev_set_name(dev, dev->init_name); + dev_set_name(dev, "%s", dev->init_name); dev->init_name = NULL; } @@ -1272,7 +1272,7 @@ struct device *__root_device_register(const char *name, struct module *owner) if (!root) return ERR_PTR(err); - err = dev_set_name(&root->dev, name); + err = dev_set_name(&root->dev, "%s", name); if (err) { kfree(root); return ERR_PTR(err); diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 3591ba7ff6f..ddeb819c8f8 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -399,7 +399,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, fw_priv->timeout.data = (u_long) fw_priv; init_timer(&fw_priv->timeout); - dev_set_name(f_dev, dev_name(device)); + dev_set_name(f_dev, "%s", dev_name(device)); f_dev->parent = device; f_dev->class = &firmware_class; dev_set_drvdata(f_dev, fw_priv); diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 59df6290951..81cb01bfc35 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -245,7 +245,7 @@ int platform_device_add(struct platform_device *pdev) if (pdev->id != -1) dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); else - dev_set_name(&pdev->dev, pdev->name); + dev_set_name(&pdev->dev, "%s", pdev->name); for (i = 0; i < pdev->num_resources; i++) { struct resource *p, *r = &pdev->resource[i]; diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 162355cd745..79a9ae5238a 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -141,7 +141,7 @@ int sysdev_class_register(struct sysdev_class *cls) cls->kset.kobj.ktype = &ktype_sysdev_class; cls->kset.kobj.kset = system_kset; - retval = kobject_set_name(&cls->kset.kobj, cls->name); + retval = kobject_set_name(&cls->kset.kobj, "%s", cls->name); if (retval) return retval; -- cgit v1.2.3 From 6fcf53acccf85b4b0d0260e66c692a341760f464 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: add nodename callbacks This adds the nodename callback for struct class, struct device_type and struct device, to allow drivers to send userspace hints on the device name and subdirectory that should be used for it. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/base/core.c b/drivers/base/core.c index 4d59975c24a..7ecb1938e59 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -162,10 +162,18 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, struct device *dev = to_dev(kobj); int retval = 0; - /* add the major/minor if present */ + /* add device node properties if present */ if (MAJOR(dev->devt)) { + const char *tmp; + const char *name; + add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); + name = device_get_nodename(dev, &tmp); + if (name) { + add_uevent_var(env, "DEVNAME=%s", name); + kfree(tmp); + } } if (dev->type && dev->type->name) @@ -1128,6 +1136,47 @@ static struct device *next_device(struct klist_iter *i) return dev; } +/** + * device_get_nodename - path of device node file + * @dev: device + * @tmp: possibly allocated string + * + * Return the relative path of a possible device node. + * Non-default names may need to allocate a memory to compose + * a name. This memory is returned in tmp and needs to be + * freed by the caller. + */ +const char *device_get_nodename(struct device *dev, const char **tmp) +{ + char *s; + + *tmp = NULL; + + /* the device type may provide a specific name */ + if (dev->type && dev->type->nodename) + *tmp = dev->type->nodename(dev); + if (*tmp) + return *tmp; + + /* the class may provide a specific name */ + if (dev->class && dev->class->nodename) + *tmp = dev->class->nodename(dev); + if (*tmp) + return *tmp; + + /* return name without allocation, tmp == NULL */ + if (strchr(dev_name(dev), '!') == NULL) + return dev_name(dev); + + /* replace '!' in the name with '/' */ + *tmp = kstrdup(dev_name(dev), GFP_KERNEL); + if (!*tmp) + return NULL; + while ((s = strchr(*tmp, '!'))) + s[0] = '/'; + return *tmp; +} + /** * device_for_each_child - device child iterator. * @parent: parent struct device. -- cgit v1.2.3 From d405640539555b601e52f7d18f1f0b1345d18bf5 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: misc: add nodename support for misc devices. This adds support for misc devices to report their requested nodename to userspace. It also updates a number of misc drivers to provide the needed subdirectory and device name to be used for them. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/char/hw_random/core.c | 1 + drivers/char/misc.c | 15 ++++++++++++--- drivers/md/dm-ioctl.c | 1 + drivers/net/tun.c | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index e5d583c84e4..fc93e2fc7c7 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -153,6 +153,7 @@ static const struct file_operations rng_chrdev_ops = { static struct miscdevice rng_miscdev = { .minor = RNG_MISCDEV_MINOR, .name = RNG_MODULE_NAME, + .devnode = "hwrng", .fops = &rng_chrdev_ops, }; diff --git a/drivers/char/misc.c b/drivers/char/misc.c index a5e0db9d766..62c99fa59e2 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -168,7 +168,6 @@ static const struct file_operations misc_fops = { .open = misc_open, }; - /** * misc_register - register a miscellaneous device * @misc: device structure @@ -217,8 +216,8 @@ int misc_register(struct miscdevice * misc) misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); dev = MKDEV(MISC_MAJOR, misc->minor); - misc->this_device = device_create(misc_class, misc->parent, dev, NULL, - "%s", misc->name); + misc->this_device = device_create(misc_class, misc->parent, dev, + misc, "%s", misc->name); if (IS_ERR(misc->this_device)) { err = PTR_ERR(misc->this_device); goto out; @@ -264,6 +263,15 @@ int misc_deregister(struct miscdevice *misc) EXPORT_SYMBOL(misc_register); EXPORT_SYMBOL(misc_deregister); +static char *misc_nodename(struct device *dev) +{ + struct miscdevice *c = dev_get_drvdata(dev); + + if (c->devnode) + return kstrdup(c->devnode, GFP_KERNEL); + return NULL; +} + static int __init misc_init(void) { int err; @@ -279,6 +287,7 @@ static int __init misc_init(void) err = -EIO; if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) goto fail_printk; + misc_class->nodename = misc_nodename; return 0; fail_printk: diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 823ceba6efa..1128d3fba79 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1513,6 +1513,7 @@ static const struct file_operations _ctl_fops = { static struct miscdevice _dm_misc = { .minor = MISC_DYNAMIC_MINOR, .name = DM_NAME, + .devnode = "mapper/control", .fops = &_ctl_fops }; diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 811d3517fce..11a0ba47b67 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1366,6 +1366,7 @@ static const struct file_operations tun_fops = { static struct miscdevice tun_miscdev = { .minor = TUN_MINOR, .name = "tun", + .devnode = "net/tun", .fops = &tun_fops, }; -- cgit v1.2.3 From f7a386c5b8ff34cd84ae922603d1c6f9d234edee Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: usb: add nodename support for usb drivers. This adds support for USB drivers to report their requested nodename to userspace. It also updates a number of USB drivers to provide the needed subdirectory and device name to be used for them. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/hid/usbhid/hiddev.c | 7 ++++++- drivers/media/video/dabusb.c | 6 ++++++ drivers/usb/class/usblp.c | 6 ++++++ drivers/usb/core/file.c | 13 ++++++++++++- drivers/usb/core/usb.c | 11 +++++++++++ drivers/usb/misc/iowarrior.c | 6 ++++++ drivers/usb/misc/legousbtower.c | 6 ++++++ 7 files changed, 53 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index e9b436d2d94..9e9421525fb 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -850,8 +850,14 @@ static const struct file_operations hiddev_fops = { #endif }; +static char *hiddev_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); +} + static struct usb_class_driver hiddev_class = { .name = "hiddev%d", + .nodename = hiddev_nodename, .fops = &hiddev_fops, .minor_base = HIDDEV_MINOR_BASE, }; @@ -955,7 +961,6 @@ static int hiddev_usbd_probe(struct usb_interface *intf, return -ENODEV; } - static /* const */ struct usb_driver hiddev_driver = { .name = "hiddev", .probe = hiddev_usbd_probe, diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index ba3709bec3f..ec2f45dde16 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c @@ -747,8 +747,14 @@ static const struct file_operations dabusb_fops = .release = dabusb_release, }; +static char *dabusb_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); +} + static struct usb_class_driver dabusb_class = { .name = "dabusb%d", + .nodename = dabusb_nodename, .fops = &dabusb_fops, .minor_base = DABUSB_MINOR, }; diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index d2747a49b97..26c09f0257d 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -1057,8 +1057,14 @@ static const struct file_operations usblp_fops = { .release = usblp_release, }; +static char *usblp_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); +} + static struct usb_class_driver usblp_class = { .name = "lp%d", + .nodename = usblp_nodename, .fops = &usblp_fops, .minor_base = USBLP_MINOR_BASE, }; diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 997e659ff69..5cef88929b3 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c @@ -67,6 +67,16 @@ static struct usb_class { struct class *class; } *usb_class; +static char *usb_nodename(struct device *dev) +{ + struct usb_class_driver *drv; + + drv = dev_get_drvdata(dev); + if (!drv || !drv->nodename) + return NULL; + return drv->nodename(dev); +} + static int init_usb_class(void) { int result = 0; @@ -90,6 +100,7 @@ static int init_usb_class(void) kfree(usb_class); usb_class = NULL; } + usb_class->class->nodename = usb_nodename; exit: return result; @@ -198,7 +209,7 @@ int usb_register_dev(struct usb_interface *intf, else temp = name; intf->usb_dev = device_create(usb_class->class, &intf->dev, - MKDEV(USB_MAJOR, minor), NULL, + MKDEV(USB_MAJOR, minor), class_driver, "%s", temp); if (IS_ERR(intf->usb_dev)) { down_write(&minor_rwsem); diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 7eee400d3e3..927a27dd2f8 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -305,10 +305,21 @@ static struct dev_pm_ops usb_device_pm_ops = { #endif /* CONFIG_PM */ + +static char *usb_nodename(struct device *dev) +{ + struct usb_device *usb_dev; + + usb_dev = to_usb_device(dev); + return kasprintf(GFP_KERNEL, "bus/usb/%03d/%03d", + usb_dev->bus->busnum, usb_dev->devnum); +} + struct device_type usb_device_type = { .name = "usb_device", .release = usb_release_dev, .uevent = usb_dev_uevent, + .nodename = usb_nodename, .pm = &usb_device_pm_ops, }; diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index a4ef77ef917..3c5fe5cee05 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -726,12 +726,18 @@ static const struct file_operations iowarrior_fops = { .poll = iowarrior_poll, }; +static char *iowarrior_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); +} + /* * usb class driver info in order to get a minor number from the usb core, * and to have the device registered with devfs and the driver core */ static struct usb_class_driver iowarrior_class = { .name = "iowarrior%d", + .nodename = iowarrior_nodename, .fops = &iowarrior_fops, .minor_base = IOWARRIOR_MINOR_BASE, }; diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index ab0f3226158..c1e2433f640 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -266,12 +266,18 @@ static const struct file_operations tower_fops = { .llseek = tower_llseek, }; +static char *legousbtower_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); +} + /* * usb class driver info in order to get a minor number from the usb core, * and to have the device registered with the driver core */ static struct usb_class_driver tower_class = { .name = "legousbtower%d", + .nodename = legousbtower_nodename, .fops = &tower_fops, .minor_base = LEGO_USB_TOWER_MINOR_BASE, }; -- cgit v1.2.3 From b03f38b685e2e1db174fb8982930e789a516f414 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: block: add nodename support for block drivers. This adds support for block drivers to report their requested nodename to userspace. It also updates a number of block drivers to provide the needed subdirectory and device name to be used for them. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/block/pktcdvd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index d57f1175948..37e0f81cada 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -2855,6 +2855,11 @@ static struct block_device_operations pktcdvd_ops = { .media_changed = pkt_media_changed, }; +static char *pktcdvd_nodename(struct gendisk *gd) +{ + return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); +} + /* * Set up mapping from pktcdvd device to CD-ROM device. */ @@ -2907,6 +2912,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) disk->fops = &pktcdvd_ops; disk->flags = GENHD_FL_REMOVABLE; strcpy(disk->disk_name, pd->name); + disk->nodename = pktcdvd_nodename; disk->private_data = pd; disk->queue = blk_alloc_queue(GFP_KERNEL); if (!disk->queue) @@ -3062,6 +3068,7 @@ static const struct file_operations pkt_ctl_fops = { static struct miscdevice pkt_misc = { .minor = MISC_DYNAMIC_MINOR, .name = DRIVER_NAME, + .name = "pktcdvd/control", .fops = &pkt_ctl_fops }; -- cgit v1.2.3 From 8a8bdcc7533b104d789d9bb3ed90da9352515e21 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: dvb: add nodename for dvb drivers This adds support to the dvb core to report the proper device name to userspace for their devices. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb/dvb-core/dvbdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index a454ee8f1e4..479dd05762a 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c @@ -447,6 +447,15 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) return 0; } +static char *dvb_nodename(struct device *dev) +{ + struct dvb_device *dvbdev = dev_get_drvdata(dev); + + return kasprintf(GFP_KERNEL, "dvb/adapter%d/%s%d", + dvbdev->adapter->num, dnames[dvbdev->type], dvbdev->id); +} + + static int __init init_dvbdev(void) { int retval; @@ -469,6 +478,7 @@ static int __init init_dvbdev(void) goto error; } dvb_class->dev_uevent = dvb_uevent; + dvb_class->nodename = dvb_nodename; return 0; error: -- cgit v1.2.3 From aa5ed63e96656bb246a9439e06c7b67d455a5aa1 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: input: add nodename for input drivers This adds support to the input core to report the proper device name to userspace for their devices. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/input/input.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/input/input.c b/drivers/input/input.c index 5d445f48789..7c237e6ac71 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1265,8 +1265,14 @@ static struct device_type input_dev_type = { .uevent = input_dev_uevent, }; +static char *input_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); +} + struct class input_class = { .name = "input", + .nodename = input_nodename, }; EXPORT_SYMBOL_GPL(input_class); -- cgit v1.2.3 From 6fd4693375b6e1001c69e78f5aefd44bf5aa7084 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: raw: add nodename for raw devices This adds support to the raw driver to report the proper device name to userspace for the raw devices. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/char/raw.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/char/raw.c b/drivers/char/raw.c index db32f0e4c7d..05f9d18b936 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -261,6 +261,11 @@ static const struct file_operations raw_ctl_fops = { static struct cdev raw_cdev; +static char *raw_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); +} + static int __init raw_init(void) { dev_t dev = MKDEV(RAW_MAJOR, 0); @@ -284,6 +289,7 @@ static int __init raw_init(void) ret = PTR_ERR(raw_class); goto error_region; } + raw_class->nodename = raw_nodename; device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); return 0; -- cgit v1.2.3 From 02200d0664bc630b3525989cb8f49880bf8bda84 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: drm: add nodename for drm devices This adds support to the drm core to report the proper device name to userspace for the drm devices. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_sysfs.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 9987ab88083..85ec31b3ff0 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -70,6 +70,11 @@ static ssize_t version_show(struct class *dev, char *buf) CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); } +static char *drm_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); +} + static CLASS_ATTR(version, S_IRUGO, version_show, NULL); /** @@ -101,6 +106,8 @@ struct class *drm_sysfs_create(struct module *owner, char *name) if (err) goto err_out_class; + class->nodename = drm_nodename; + return class; err_out_class: -- cgit v1.2.3 From 1ce8a0d396288f28070483a8190843c23b8282f4 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 30 Apr 2009 15:23:42 +0200 Subject: Driver Core: aoe: add nodename for aoe devices This adds support to the AOE core to report the proper device name to userspace for the AOE devices. Signed-off-by: Kay Sievers Signed-off-by: Jan Blunck Signed-off-by: Greg Kroah-Hartman --- drivers/block/aoe/aoechr.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c index 200efc4d2c1..19888354188 100644 --- a/drivers/block/aoe/aoechr.c +++ b/drivers/block/aoe/aoechr.c @@ -266,6 +266,11 @@ static const struct file_operations aoe_fops = { .owner = THIS_MODULE, }; +static char *aoe_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); +} + int __init aoechr_init(void) { @@ -283,6 +288,8 @@ aoechr_init(void) unregister_chrdev(AOE_MAJOR, "aoechr"); return PTR_ERR(aoe_class); } + aoe_class->nodename = aoe_nodename; + for (i = 0; i < ARRAY_SIZE(chardevs); ++i) device_create(aoe_class, NULL, MKDEV(AOE_MAJOR, chardevs[i].minor), NULL, -- cgit v1.2.3 From 4b9d0d3b81ec0900971cbe8aba8ba0ae9c08a087 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: eisa: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Signed-off-by: Greg Kroah-Hartman --- drivers/eisa/pci_eisa.c | 2 +- drivers/eisa/virtual_root.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index 74edb1d0110..0dd0f633b18 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c @@ -31,11 +31,11 @@ static int __init pci_eisa_init(struct pci_dev *pdev, } pci_eisa_root.dev = &pdev->dev; - pci_eisa_root.dev->driver_data = &pci_eisa_root; pci_eisa_root.res = pdev->bus->resource[0]; pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; pci_eisa_root.slots = EISA_MAX_SLOTS; pci_eisa_root.dma_mask = pdev->dma_mask; + dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); if (eisa_root_register (&pci_eisa_root)) { printk (KERN_ERR "pci_eisa : Could not register EISA root\n"); diff --git a/drivers/eisa/virtual_root.c b/drivers/eisa/virtual_root.c index 3074879f231..535e4f9c83f 100644 --- a/drivers/eisa/virtual_root.c +++ b/drivers/eisa/virtual_root.c @@ -57,7 +57,7 @@ static int __init virtual_eisa_root_init (void) eisa_bus_root.force_probe = force_probe; - eisa_root_dev.dev.driver_data = &eisa_bus_root; + dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root); if (eisa_root_register (&eisa_bus_root)) { /* A real bridge may have been registered before -- cgit v1.2.3 From d961450da5e16dae8da276c0a234764872b2307b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: firewire: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux1394-devel@lists.sourceforge.net Acked-by: Stefan Richter Cc: Kristian Hoegsberg Signed-off-by: Greg Kroah-Hartman --- drivers/firewire/fw-sbp2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 2bcf51557c7..a70e66e78c7 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -1125,7 +1125,7 @@ static int sbp2_probe(struct device *dev) return -ENOMEM; tgt = (struct sbp2_target *)shost->hostdata; - unit->device.driver_data = tgt; + dev_set_drvdata(&unit->device, tgt); tgt->unit = unit; kref_init(&tgt->kref); INIT_LIST_HEAD(&tgt->lu_list); @@ -1180,7 +1180,7 @@ static int sbp2_probe(struct device *dev) static int sbp2_remove(struct device *dev) { struct fw_unit *unit = fw_unit(dev); - struct sbp2_target *tgt = unit->device.driver_data; + struct sbp2_target *tgt = dev_get_drvdata(&unit->device); sbp2_target_put(tgt); return 0; @@ -1240,7 +1240,7 @@ static void sbp2_reconnect(struct work_struct *work) static void sbp2_update(struct fw_unit *unit) { - struct sbp2_target *tgt = unit->device.driver_data; + struct sbp2_target *tgt = dev_get_drvdata(&unit->device); struct sbp2_logical_unit *lu; fw_device_enable_phys_dma(fw_device(unit->device.parent)); -- cgit v1.2.3 From fcb5207723919ad85178420633d55efea80b652d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: ide: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-ide@vger.kernel.org Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/ide/ide-pm.c | 6 ++++-- drivers/ide/ide-probe.c | 4 ++-- drivers/ide/ide_platform.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index ba1488bd843..c14ca144cff 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c @@ -3,7 +3,8 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) { - ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive); + ide_drive_t *drive = dev_get_drvdata(dev); + ide_drive_t *pair = ide_get_pair_dev(drive); ide_hwif_t *hwif = drive->hwif; struct request *rq; struct request_pm_state rqpm; @@ -34,7 +35,8 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) int generic_ide_resume(struct device *dev) { - ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive); + ide_drive_t *drive = dev_get_drvdata(dev); + ide_drive_t *pair = ide_get_pair_dev(drive); ide_hwif_t *hwif = drive->hwif; struct request *rq; struct request_pm_state rqpm; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index f371b0de314..79e0af3fd15 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -535,7 +535,7 @@ static int ide_register_port(ide_hwif_t *hwif) /* register with global device tree */ dev_set_name(&hwif->gendev, hwif->name); - hwif->gendev.driver_data = hwif; + dev_set_drvdata(&hwif->gendev, hwif); if (hwif->gendev.parent == NULL) hwif->gendev.parent = hwif->dev; hwif->gendev.release = hwif_release_dev; @@ -987,9 +987,9 @@ static void hwif_register_devices(ide_hwif_t *hwif) int ret; dev_set_name(dev, "%u.%u", hwif->index, i); + dev_set_drvdata(dev, drive); dev->parent = &hwif->gendev; dev->bus = &ide_bus_type; - dev->driver_data = drive; dev->release = drive_release_dev; ret = device_register(dev); diff --git a/drivers/ide/ide_platform.c b/drivers/ide/ide_platform.c index ee9b55ecc62..b579fbe8837 100644 --- a/drivers/ide/ide_platform.c +++ b/drivers/ide/ide_platform.c @@ -112,7 +112,7 @@ out: static int __devexit plat_ide_remove(struct platform_device *pdev) { - struct ide_host *host = pdev->dev.driver_data; + struct ide_host *host = dev_get_drvdata(&pdev->dev); ide_host_remove(host); -- cgit v1.2.3 From bab030595a4f84c679fe26e05263e3dc9f560391 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: ieee1394: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux1394-devel@lists.sourceforge.net Acked-by: Stefan Richter Cc: Ben Collins Signed-off-by: Greg Kroah-Hartman --- drivers/ieee1394/eth1394.c | 16 +++++++--------- drivers/ieee1394/sbp2.c | 8 ++++---- 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 4ca103577c0..f5c586c2bba 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -361,7 +361,7 @@ static int eth1394_new_node(struct eth1394_host_info *hi, node_info->pdg.sz = 0; node_info->fifo = CSR1212_INVALID_ADDR_SPACE; - ud->device.driver_data = node_info; + dev_set_drvdata(&ud->device, node_info); new_node->ud = ud; priv = netdev_priv(hi->dev); @@ -406,7 +406,7 @@ static int eth1394_remove(struct device *dev) list_del(&old_node->list); kfree(old_node); - node_info = (struct eth1394_node_info*)ud->device.driver_data; + node_info = dev_get_drvdata(&ud->device); spin_lock_irqsave(&node_info->pdg.lock, flags); /* The partial datagram list should be empty, but we'll just @@ -416,7 +416,7 @@ static int eth1394_remove(struct device *dev) spin_unlock_irqrestore(&node_info->pdg.lock, flags); kfree(node_info); - ud->device.driver_data = NULL; + dev_set_drvdata(&ud->device, NULL); return 0; } @@ -688,7 +688,7 @@ static void ether1394_host_reset(struct hpsb_host *host) ether1394_reset_priv(dev, 0); list_for_each_entry(node, &priv->ip_node_list, list) { - node_info = node->ud->device.driver_data; + node_info = dev_get_drvdata(&node->ud->device); spin_lock_irqsave(&node_info->pdg.lock, flags); @@ -872,8 +872,7 @@ static __be16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, if (!node) return cpu_to_be16(0); - node_info = - (struct eth1394_node_info *)node->ud->device.driver_data; + node_info = dev_get_drvdata(&node->ud->device); /* Update our speed/payload/fifo_offset table */ node_info->maxpayload = maxpayload; @@ -1080,7 +1079,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, priv->ud_list[NODEID_TO_NODE(srcid)] = ud; } - node_info = (struct eth1394_node_info *)ud->device.driver_data; + node_info = dev_get_drvdata(&ud->device); /* First, did we receive a fragmented or unfragmented datagram? */ hdr->words.word1 = ntohs(hdr->words.word1); @@ -1617,8 +1616,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) if (!node) goto fail; - node_info = - (struct eth1394_node_info *)node->ud->device.driver_data; + node_info = dev_get_drvdata(&node->ud->device); if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) goto fail; diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index a51ab233342..83b734aec92 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -718,7 +718,7 @@ static int sbp2_remove(struct device *dev) struct scsi_device *sdev; ud = container_of(dev, struct unit_directory, device); - lu = ud->device.driver_data; + lu = dev_get_drvdata(&ud->device); if (!lu) return 0; @@ -746,7 +746,7 @@ static int sbp2_remove(struct device *dev) static int sbp2_update(struct unit_directory *ud) { - struct sbp2_lu *lu = ud->device.driver_data; + struct sbp2_lu *lu = dev_get_drvdata(&ud->device); if (sbp2_reconnect_device(lu) != 0) { /* @@ -815,7 +815,7 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud) atomic_set(&lu->state, SBP2LU_STATE_RUNNING); INIT_WORK(&lu->protocol_work, NULL); - ud->device.driver_data = lu; + dev_set_drvdata(&ud->device, lu); hi = hpsb_get_hostinfo(&sbp2_highlevel, ud->ne->host); if (!hi) { @@ -1051,7 +1051,7 @@ static void sbp2_remove_device(struct sbp2_lu *lu) hpsb_unregister_addrspace(&sbp2_highlevel, hi->host, lu->status_fifo_addr); - lu->ud->device.driver_data = NULL; + dev_set_drvdata(&lu->ud->device, NULL); module_put(hi->host->driver->owner); no_hi: -- cgit v1.2.3 From 3f7c58a05fe4aa71983ea27959b7ad840950537e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: infiniband: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: general@lists.openfabrics.org Cc: Roland Dreier Cc: Hal Rosenstock Cc: Sean Hefty Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index 5c04cfb54cb..158a214da2f 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c @@ -760,9 +760,9 @@ int ib_device_register_sysfs(struct ib_device *device) int i; class_dev->class = &ib_class; - class_dev->driver_data = device; class_dev->parent = device->dma_device; dev_set_name(class_dev, device->name); + dev_set_drvdata(class_dev, device); INIT_LIST_HEAD(&device->port_list); -- cgit v1.2.3 From 017596b61f324946299fa94d9ef6f08b7478a3d8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: input: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/wm97xx-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 69af8385ab1..2957d48e004 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -569,7 +569,7 @@ static int wm97xx_probe(struct device *dev) mutex_init(&wm->codec_mutex); wm->dev = dev; - dev->driver_data = wm; + dev_set_drvdata(dev, wm); wm->ac97 = to_ac97_t(dev); /* check that we have a supported codec */ -- cgit v1.2.3 From 79510cdbc76265426c6d75326436624393694ea7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: media: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Mauro Carvalho Chehab Acked-by: Mike Isely Cc: linux-media@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb/firewire/firedtv-1394.c | 4 ++-- drivers/media/dvb/firewire/firedtv-dvb.c | 2 +- drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'drivers') diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c index 4e207658c5d..2b6eeeab5b2 100644 --- a/drivers/media/dvb/firewire/firedtv-1394.c +++ b/drivers/media/dvb/firewire/firedtv-1394.c @@ -225,7 +225,7 @@ fail_free: static int node_remove(struct device *dev) { - struct firedtv *fdtv = dev->driver_data; + struct firedtv *fdtv = dev_get_drvdata(dev); fdtv_dvb_unregister(fdtv); @@ -242,7 +242,7 @@ static int node_remove(struct device *dev) static int node_update(struct unit_directory *ud) { - struct firedtv *fdtv = ud->device.driver_data; + struct firedtv *fdtv = dev_get_drvdata(&ud->device); if (fdtv->isochannel >= 0) cmp_establish_pp_connection(fdtv, fdtv->subunit, diff --git a/drivers/media/dvb/firewire/firedtv-dvb.c b/drivers/media/dvb/firewire/firedtv-dvb.c index 9d308dd32a5..5742fde79d9 100644 --- a/drivers/media/dvb/firewire/firedtv-dvb.c +++ b/drivers/media/dvb/firewire/firedtv-dvb.c @@ -268,7 +268,7 @@ struct firedtv *fdtv_alloc(struct device *dev, if (!fdtv) return NULL; - dev->driver_data = fdtv; + dev_set_drvdata(dev, fdtv); fdtv->device = dev; fdtv->isochannel = -1; fdtv->voltage = 0xff; diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 299c1cbc383..6c23456e0bd 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -539,7 +539,7 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp) &sfp->attr_unit_number); } pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); - sfp->class_dev->driver_data = NULL; + dev_set_drvdata(sfp->class_dev, NULL); device_unregister(sfp->class_dev); sfp->class_dev = NULL; } @@ -549,7 +549,7 @@ static ssize_t v4l_minor_number_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%d\n", pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, @@ -561,7 +561,7 @@ static ssize_t bus_info_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%s\n", pvr2_hdw_get_bus_info(sfp->channel.hdw)); @@ -572,7 +572,7 @@ static ssize_t hdw_name_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%s\n", pvr2_hdw_get_type(sfp->channel.hdw)); @@ -583,7 +583,7 @@ static ssize_t hdw_desc_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%s\n", pvr2_hdw_get_desc(sfp->channel.hdw)); @@ -595,7 +595,7 @@ static ssize_t v4l_radio_minor_number_show(struct device *class_dev, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%d\n", pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, @@ -607,7 +607,7 @@ static ssize_t unit_number_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%d\n", pvr2_hdw_get_unit_number(sfp->channel.hdw)); @@ -635,7 +635,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, class_dev->parent = &usb_dev->dev; sfp->class_dev = class_dev; - class_dev->driver_data = sfp; + dev_set_drvdata(class_dev, sfp); ret = device_register(class_dev); if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, @@ -792,7 +792,7 @@ static ssize_t debuginfo_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; pvr2_hdw_trigger_module_log(sfp->channel.hdw); return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE); @@ -803,7 +803,7 @@ static ssize_t debugcmd_show(struct device *class_dev, struct device_attribute *attr, char *buf) { struct pvr2_sysfs *sfp; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE); } @@ -816,7 +816,7 @@ static ssize_t debugcmd_store(struct device *class_dev, struct pvr2_sysfs *sfp; int ret; - sfp = (struct pvr2_sysfs *)class_dev->driver_data; + sfp = dev_get_drvdata(class_dev); if (!sfp) return -EINVAL; ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count); -- cgit v1.2.3 From 1902a9e62ba34a1071407ab61cef626e019a0923 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: mfd: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Samuel Ortiz Acked-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/mfd/htc-pasic3.c | 4 ++-- drivers/mfd/pcf50633-core.c | 2 +- drivers/mfd/wm8400-core.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c index 386da1566fc..cb73051e43d 100644 --- a/drivers/mfd/htc-pasic3.c +++ b/drivers/mfd/htc-pasic3.c @@ -35,7 +35,7 @@ struct pasic3_data { */ void pasic3_write_register(struct device *dev, u32 reg, u8 val) { - struct pasic3_data *asic = dev->driver_data; + struct pasic3_data *asic = dev_get_drvdata(dev); int bus_shift = asic->bus_shift; void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); void __iomem *data = asic->mapping + (REG_DATA << bus_shift); @@ -50,7 +50,7 @@ EXPORT_SYMBOL(pasic3_write_register); /* for leds-pasic3 */ */ u8 pasic3_read_register(struct device *dev, u32 reg) { - struct pasic3_data *asic = dev->driver_data; + struct pasic3_data *asic = dev_get_drvdata(dev); int bus_shift = asic->bus_shift; void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); void __iomem *data = asic->mapping + (REG_DATA << bus_shift); diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 11a6248cc1c..082c197ab9b 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -618,7 +618,7 @@ static int __devinit pcf50633_probe(struct i2c_client *client, pdev->dev.parent = pcf->dev; pdev->dev.platform_data = &pdata->reg_init_data[i]; - pdev->dev.driver_data = pcf; + dev_set_drvdata(&pdev->dev, pcf); pcf->regulator_pdev[i] = pdev; platform_device_add(pdev); diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c index cf30d06a010..7c21bf79156 100644 --- a/drivers/mfd/wm8400-core.c +++ b/drivers/mfd/wm8400-core.c @@ -265,7 +265,7 @@ static int wm8400_init(struct wm8400 *wm8400, mutex_init(&wm8400->io_lock); - wm8400->dev->driver_data = wm8400; + dev_set_drvdata(wm8400->dev, wm8400); /* Check that this is actually a WM8400 */ ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®); -- cgit v1.2.3 From 8952f593ea66bff4a30f9e641dc6c79832ca64cf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: PCIE: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-pci@vger.kernel.org Cc: Jesse Barnes Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pcie/portdrv_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index e3998250386..13ffdc35ea0 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -275,7 +275,7 @@ static void pcie_device_init(struct pci_dev *parent, struct pcie_device *dev, memset(device, 0, sizeof(struct device)); device->bus = &pcie_port_bus_type; device->driver = NULL; - device->driver_data = NULL; + dev_set_drvdata(device, NULL); device->release = release_pcie_device; /* callback to free pcie dev */ dev_set_name(device, "%s:pcie%02x", pci_name(parent), get_descriptor_id(port_type, service_type)); -- cgit v1.2.3 From f3e7a7b64a79a3d82835ce83fb32616df762d456 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: pcmcia: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-pcmcia@lists.infradead.org Cc: Dominik Brodowski Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/ds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 8f2bb01b098..304ff6d5cf3 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -394,7 +394,7 @@ static int pcmcia_device_probe(struct device * dev) p_drv = to_pcmcia_drv(dev->driver); s = p_dev->socket; - /* The PCMCIA code passes the match data in via dev->driver_data + /* The PCMCIA code passes the match data in via dev_set_drvdata(dev) * which is an ugly hack. Once the driver probe is called it may * and often will overwrite the match data so we must save it first * @@ -404,7 +404,7 @@ static int pcmcia_device_probe(struct device * dev) * call which will then check whether there are two * pseudo devices, and if not, add the second one. */ - did = p_dev->dev.driver_data; + did = dev_get_drvdata(&p_dev->dev); ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); @@ -499,7 +499,7 @@ static int pcmcia_device_remove(struct device * dev) * pseudo multi-function card, we need to unbind * all devices */ - did = p_dev->dev.driver_data; + did = dev_get_drvdata(&p_dev->dev); if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && (p_dev->socket->device_count != 0) && (p_dev->device_no == 0)) @@ -978,7 +978,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, return 0; } - dev->dev.driver_data = (void *) did; + dev_set_drvdata(&dev->dev, did); return 1; } -- cgit v1.2.3 From 78c55d76b84628862079351f77aa0f4aa3b65f58 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: scsi: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-scsi@vger.kernel.org Cc: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/aha1740.c | 2 +- drivers/scsi/libsrp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index ed0e3e55652..538135783aa 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c @@ -646,7 +646,7 @@ static int aha1740_probe (struct device *dev) static __devexit int aha1740_remove (struct device *dev) { - struct Scsi_Host *shpnt = dev->driver_data; + struct Scsi_Host *shpnt = dev_get_drvdata(dev); struct aha1740_hostdata *host = HOSTDATA (shpnt); scsi_remove_host(shpnt); diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c index 15e2d132e8b..2742ae8a3d0 100644 --- a/drivers/scsi/libsrp.c +++ b/drivers/scsi/libsrp.c @@ -135,7 +135,7 @@ int srp_target_alloc(struct srp_target *target, struct device *dev, INIT_LIST_HEAD(&target->cmd_queue); target->dev = dev; - target->dev->driver_data = target; + dev_set_drvdata(target->dev, target); target->srp_iu_size = iu_size; target->rx_ring_size = nr; -- cgit v1.2.3 From 0e968a3b6da710294a56460473cac32dc821fd4a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: thermal: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/thermal_sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 5e38ba10a3a..0a69672097a 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c @@ -417,7 +417,7 @@ static LIST_HEAD(thermal_hwmon_list); static ssize_t name_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct thermal_hwmon_device *hwmon = dev->driver_data; + struct thermal_hwmon_device *hwmon = dev_get_drvdata(dev); return sprintf(buf, "%s\n", hwmon->type); } static DEVICE_ATTR(name, 0444, name_show, NULL); @@ -488,7 +488,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) result = PTR_ERR(hwmon->device); goto free_mem; } - hwmon->device->driver_data = hwmon; + dev_set_drvdata(hwmon->device, hwmon); result = device_create_file(hwmon->device, &dev_attr_name); if (result) goto unregister_hwmon_device; -- cgit v1.2.3 From a1b4b12b372e76d22d4f3bf58b47e4cf2fb132fe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Apr 2009 14:43:31 -0700 Subject: xen block: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: xen-devel@lists.xensource.com Cc: virtualization@lists.osdl.org Acked-by: Chris Wright Acked-by: Jeremy Fitzhardinge Signed-off-by: Greg Kroah-Hartman --- drivers/block/xen-blkfront.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c1996829d5e..e53284767f7 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -753,12 +753,12 @@ static int blkfront_probe(struct xenbus_device *dev, /* Front end dir is a number, which is used as the id. */ info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); - dev->dev.driver_data = info; + dev_set_drvdata(&dev->dev, info); err = talk_to_backend(dev, info); if (err) { kfree(info); - dev->dev.driver_data = NULL; + dev_set_drvdata(&dev->dev, NULL); return err; } @@ -843,7 +843,7 @@ static int blkif_recover(struct blkfront_info *info) */ static int blkfront_resume(struct xenbus_device *dev) { - struct blkfront_info *info = dev->dev.driver_data; + struct blkfront_info *info = dev_get_drvdata(&dev->dev); int err; dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); @@ -922,7 +922,7 @@ static void blkfront_connect(struct blkfront_info *info) */ static void blkfront_closing(struct xenbus_device *dev) { - struct blkfront_info *info = dev->dev.driver_data; + struct blkfront_info *info = dev_get_drvdata(&dev->dev); unsigned long flags; dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename); @@ -957,7 +957,7 @@ static void blkfront_closing(struct xenbus_device *dev) static void backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state) { - struct blkfront_info *info = dev->dev.driver_data; + struct blkfront_info *info = dev_get_drvdata(&dev->dev); struct block_device *bd; dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); @@ -997,7 +997,7 @@ static void backend_changed(struct xenbus_device *dev, static int blkfront_remove(struct xenbus_device *dev) { - struct blkfront_info *info = dev->dev.driver_data; + struct blkfront_info *info = dev_get_drvdata(&dev->dev); dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename); @@ -1010,7 +1010,7 @@ static int blkfront_remove(struct xenbus_device *dev) static int blkfront_is_ready(struct xenbus_device *dev) { - struct blkfront_info *info = dev->dev.driver_data; + struct blkfront_info *info = dev_get_drvdata(&dev->dev); return info->is_ready; } -- cgit v1.2.3 From 317ccc4246bf205807c4d2f270d7fc8f024a9dc3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: hvcs: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Paul Mackerras Acked-by: Stephen Rothwell Cc: Roel Kluin Cc: Benjamin Herrenschmidt Signed-off-by: Greg Kroah-Hartman --- drivers/char/hvcs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index c76bccf5354..7d64e4230e6 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c @@ -347,7 +347,7 @@ static void __exit hvcs_module_exit(void); static inline struct hvcs_struct *from_vio_dev(struct vio_dev *viod) { - return viod->dev.driver_data; + return dev_get_drvdata(&viod->dev); } /* The sysfs interface for the driver and devices */ @@ -785,7 +785,7 @@ static int __devinit hvcs_probe( kref_init(&hvcsd->kref); hvcsd->vdev = dev; - dev->dev.driver_data = hvcsd; + dev_set_drvdata(&dev->dev, hvcsd); hvcsd->index = index; @@ -831,7 +831,7 @@ static int __devinit hvcs_probe( static int __devexit hvcs_remove(struct vio_dev *dev) { - struct hvcs_struct *hvcsd = dev->dev.driver_data; + struct hvcs_struct *hvcsd = dev_get_drvdata(&dev->dev); unsigned long flags; struct tty_struct *tty; -- cgit v1.2.3 From 559fde706873256903155b3a62b05d0f52d62ab9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: ibmvscsi: gadget: at91_udc: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-scsi@vger.kernel.org Cc: James Bottomley Cc: Brian King Cc: Robert Jennings Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ibmvscsi/ibmvscsi.c | 6 +++--- drivers/scsi/ibmvscsi/ibmvstgt.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 11d2602ae88..869a11bdccb 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -1877,7 +1877,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) unsigned long wait_switch = 0; int rc; - vdev->dev.driver_data = NULL; + dev_set_drvdata(&vdev->dev, NULL); host = scsi_host_alloc(&driver_template, sizeof(*hostdata)); if (!host) { @@ -1949,7 +1949,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) scsi_scan_host(host); } - vdev->dev.driver_data = hostdata; + dev_set_drvdata(&vdev->dev, hostdata); return 0; add_srp_port_failed: @@ -1968,7 +1968,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) static int ibmvscsi_remove(struct vio_dev *vdev) { - struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data; + struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); unmap_persist_bufs(hostdata); release_event_pool(&hostdata->pool, hostdata); ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index e2dd6a45924..d5eaf972710 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c @@ -892,7 +892,7 @@ free_vport: static int ibmvstgt_remove(struct vio_dev *dev) { - struct srp_target *target = (struct srp_target *) dev->dev.driver_data; + struct srp_target *target = dev_get_drvdata(&dev->dev); struct Scsi_Host *shost = target->shost; struct vio_port *vport = target->ldata; -- cgit v1.2.3 From f899c2ddd45f2515deb446e2b143e4a686a49aee Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: infiniband: ehca: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Sean Hefty Cc: Roland Dreier Cc: Hal Rosenstock Cc: general@lists.openfabrics.org Cc: Christoph Raisch Acked-by: Hoang-Nam Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/ehca/ehca_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 85905ab9391..ce4e6eff479 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c @@ -636,7 +636,7 @@ static ssize_t ehca_show_##name(struct device *dev, \ struct hipz_query_hca *rblock; \ int data; \ \ - shca = dev->driver_data; \ + shca = dev_get_drvdata(dev); \ \ rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \ if (!rblock) { \ @@ -680,7 +680,7 @@ static ssize_t ehca_show_adapter_handle(struct device *dev, struct device_attribute *attr, char *buf) { - struct ehca_shca *shca = dev->driver_data; + struct ehca_shca *shca = dev_get_drvdata(dev); return sprintf(buf, "%llx\n", shca->ipz_hca_handle.handle); @@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device *dev, shca->ofdev = dev; shca->ipz_hca_handle.handle = *handle; - dev->dev.driver_data = shca; + dev_set_drvdata(&dev->dev, shca); ret = ehca_sense_attributes(shca); if (ret < 0) { @@ -878,7 +878,7 @@ probe1: static int __devexit ehca_remove(struct of_device *dev) { - struct ehca_shca *shca = dev->dev.driver_data; + struct ehca_shca *shca = dev_get_drvdata(&dev->dev); unsigned long flags; int ret; -- cgit v1.2.3 From 9de33df41f712712ccd3297c898e365b50fb91ef Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: ipmi: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: openipmi-developer@lists.sourceforge.net Acked-by: Corey Minyard Signed-off-by: Greg Kroah-Hartman --- drivers/char/ipmi/ipmi_si_intf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 259644646b8..d2e698096ac 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2375,14 +2375,14 @@ static int __devinit ipmi_of_probe(struct of_device *dev, info->io.addr_data, info->io.regsize, info->io.regspacing, info->irq); - dev->dev.driver_data = (void *) info; + dev_set_drvdata(&dev->dev, info); return try_smi_init(info); } static int __devexit ipmi_of_remove(struct of_device *dev) { - cleanup_one_si(dev->dev.driver_data); + cleanup_one_si(dev_get_drvdata(&dev->dev)); return 0; } -- cgit v1.2.3 From 3cf62a5a82f9819896d72b20f8c55e0858c7aec8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: of_serial: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Benjamin Herrenschmidt Acked-by: Arnd Bergmann Acked-by: Stephen Rothwell Cc: Paul Mackerras Cc: Matthias Fuchs Signed-off-by: Greg Kroah-Hartman --- drivers/serial/of_serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 14f8fa9135b..54483cd3529 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c @@ -122,7 +122,7 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev, info->type = port_type; info->line = ret; - ofdev->dev.driver_data = info; + dev_set_drvdata(&ofdev->dev, info); return 0; out: kfree(info); @@ -135,7 +135,7 @@ out: */ static int of_platform_serial_remove(struct of_device *ofdev) { - struct of_serial_info *info = ofdev->dev.driver_data; + struct of_serial_info *info = dev_get_drvdata(&ofdev->dev); switch (info->type) { #ifdef CONFIG_SERIAL_8250 case PORT_8250 ... PORT_MAX_8250: -- cgit v1.2.3 From d18dbfa7aaa8d50c2c1c66359f0ab6b085dfa03f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: parisc: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-parisc@vger.kernel.org Cc: Helge Deller Cc: Kyle McMartin Signed-off-by: Greg Kroah-Hartman --- drivers/parisc/eisa.c | 2 +- drivers/parisc/sba_iommu.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index f415fdd9a88..5b89f404e66 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -373,7 +373,7 @@ static int __init eisa_probe(struct parisc_device *dev) if (result >= 0) { /* FIXME : Don't enumerate the bus twice. */ eisa_dev.root.dev = &dev->dev; - dev->dev.driver_data = &eisa_dev.root; + dev_set_drvdata(&dev->dev, &eisa_dev.root); eisa_dev.root.bus_base_addr = 0; eisa_dev.root.res = &eisa_dev.hba.io_space; eisa_dev.root.slots = result; diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index e5999c4cedc..d46dd57450a 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -2010,7 +2010,7 @@ void __init sba_init(void) void * sba_get_iommu(struct parisc_device *pci_hba) { struct parisc_device *sba_dev = parisc_parent(pci_hba); - struct sba_device *sba = sba_dev->dev.driver_data; + struct sba_device *sba = dev_get_drvdata(&sba_dev->dev); char t = sba_dev->id.hw_type; int iocnum = (pci_hba->hw_path >> 3); /* rope # */ @@ -2031,7 +2031,7 @@ void * sba_get_iommu(struct parisc_device *pci_hba) void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r) { struct parisc_device *sba_dev = parisc_parent(pci_hba); - struct sba_device *sba = sba_dev->dev.driver_data; + struct sba_device *sba = dev_get_drvdata(&sba_dev->dev); char t = sba_dev->id.hw_type; int i; int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */ @@ -2073,7 +2073,7 @@ void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r) void sba_distributed_lmmio(struct parisc_device *pci_hba, struct resource *r ) { struct parisc_device *sba_dev = parisc_parent(pci_hba); - struct sba_device *sba = sba_dev->dev.driver_data; + struct sba_device *sba = dev_get_drvdata(&sba_dev->dev); char t = sba_dev->id.hw_type; int base, size; int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */ -- cgit v1.2.3 From 61616115d748e2eb76c43715383e602b09d9bf50 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: parport: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/parport/parport_gsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index ea31a452b15..5d6de380e42 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -376,14 +376,14 @@ static int __devinit parport_init_chip(struct parisc_device *dev) /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL); if (p) parport_count++; - dev->dev.driver_data = p; + dev_set_drvdata(&dev->dev, p); return 0; } static int __devexit parport_remove_chip(struct parisc_device *dev) { - struct parport *p = dev->dev.driver_data; + struct parport *p = dev_get_drvdata(&dev->dev); if (p) { struct parport_gsc_private *priv = p->private_data; struct parport_operations *ops = p->ops; -- cgit v1.2.3 From dff59b64af94dc588044d70f3708cb835055c5b6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: s390: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Thanks to Sebastian Ott for fixing a few typos in my original version of this patch. Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Sebastian Ott Cc: linux-s390@vger.kernel.org Cc: linux390@de.ibm.com Signed-off-by: Greg Kroah-Hartman --- drivers/s390/char/con3215.c | 16 ++++++------- drivers/s390/char/raw3270.c | 16 ++++++------- drivers/s390/char/tape_34xx.c | 2 +- drivers/s390/char/tape_3590.c | 2 +- drivers/s390/char/tape_core.c | 22 +++++++++--------- drivers/s390/char/vmlogrdr.c | 12 +++++----- drivers/s390/char/vmur.c | 16 ++++++------- drivers/s390/net/claw.c | 52 +++++++++++++++++++++---------------------- drivers/s390/net/lcs.c | 20 ++++++++--------- drivers/s390/net/lcs.h | 4 ++-- drivers/s390/net/netiucv.c | 47 +++++++++++++++++++------------------- 11 files changed, 105 insertions(+), 104 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 9ab06e0dad4..c639361d808 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -368,7 +368,7 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) int cstat, dstat; int count; - raw = cdev->dev.driver_data; + raw = dev_get_drvdata(&cdev->dev); req = (struct raw3215_req *) intparm; cstat = irb->scsw.cmd.cstat; dstat = irb->scsw.cmd.dstat; @@ -635,7 +635,7 @@ raw3215_probe (struct ccw_device *cdev) int line; /* Console is special. */ - if (raw3215[0] && (cdev->dev.driver_data == raw3215[0])) + if (raw3215[0] && (raw3215[0] == dev_get_drvdata(&cdev->dev))) return 0; raw = kmalloc(sizeof(struct raw3215_info) + RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA); @@ -669,7 +669,7 @@ raw3215_probe (struct ccw_device *cdev) } init_waitqueue_head(&raw->empty_wait); - cdev->dev.driver_data = raw; + dev_set_drvdata(&cdev->dev, raw); cdev->handler = raw3215_irq; return 0; @@ -681,9 +681,9 @@ raw3215_remove (struct ccw_device *cdev) struct raw3215_info *raw; ccw_device_set_offline(cdev); - raw = cdev->dev.driver_data; + raw = dev_get_drvdata(&cdev->dev); if (raw) { - cdev->dev.driver_data = NULL; + dev_set_drvdata(&cdev->dev, NULL); kfree(raw->buffer); kfree(raw); } @@ -694,7 +694,7 @@ raw3215_set_online (struct ccw_device *cdev) { struct raw3215_info *raw; - raw = cdev->dev.driver_data; + raw = dev_get_drvdata(&cdev->dev); if (!raw) return -ENODEV; @@ -706,7 +706,7 @@ raw3215_set_offline (struct ccw_device *cdev) { struct raw3215_info *raw; - raw = cdev->dev.driver_data; + raw = dev_get_drvdata(&cdev->dev); if (!raw) return -ENODEV; @@ -848,7 +848,7 @@ con3215_init(void) raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE); raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE); raw->cdev = cdev; - cdev->dev.driver_data = raw; + dev_set_drvdata(&cdev->dev, raw); cdev->handler = raw3215_irq; raw->flags |= RAW3215_FIXED; diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 0b15cf107ec..1ab69df2684 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c @@ -355,7 +355,7 @@ raw3270_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) struct raw3270_request *rq; int rc; - rp = (struct raw3270 *) cdev->dev.driver_data; + rp = dev_get_drvdata(&cdev->dev); if (!rp) return; rq = (struct raw3270_request *) intparm; @@ -828,7 +828,7 @@ raw3270_setup_device(struct ccw_device *cdev, struct raw3270 *rp, char *ascebc) if (rp->minor == -1) return -EUSERS; rp->cdev = cdev; - cdev->dev.driver_data = rp; + dev_set_drvdata(&cdev->dev, rp); cdev->handler = raw3270_irq; return 0; } @@ -1105,7 +1105,7 @@ raw3270_delete_device(struct raw3270 *rp) /* Disconnect from ccw_device. */ cdev = rp->cdev; rp->cdev = NULL; - cdev->dev.driver_data = NULL; + dev_set_drvdata(&cdev->dev, NULL); cdev->handler = NULL; /* Put ccw_device structure. */ @@ -1129,7 +1129,7 @@ static ssize_t raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%i\n", - ((struct raw3270 *) dev->driver_data)->model); + ((struct raw3270 *) dev_get_drvdata(dev))->model); } static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); @@ -1137,7 +1137,7 @@ static ssize_t raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%i\n", - ((struct raw3270 *) dev->driver_data)->rows); + ((struct raw3270 *) dev_get_drvdata(dev))->rows); } static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); @@ -1145,7 +1145,7 @@ static ssize_t raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%i\n", - ((struct raw3270 *) dev->driver_data)->cols); + ((struct raw3270 *) dev_get_drvdata(dev))->cols); } static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); @@ -1282,7 +1282,7 @@ raw3270_remove (struct ccw_device *cdev) struct raw3270_view *v; struct raw3270_notifier *np; - rp = cdev->dev.driver_data; + rp = dev_get_drvdata(&cdev->dev); /* * _remove is the opposite of _probe; it's probe that * should set up rp. raw3270_remove gets entered for @@ -1330,7 +1330,7 @@ raw3270_set_offline (struct ccw_device *cdev) { struct raw3270 *rp; - rp = cdev->dev.driver_data; + rp = dev_get_drvdata(&cdev->dev); if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) return -EBUSY; raw3270_remove(cdev); diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index 2d00a383a47..997ed580758 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c @@ -1289,7 +1289,7 @@ static int tape_34xx_online(struct ccw_device *cdev) { return tape_generic_online( - cdev->dev.driver_data, + dev_get_drvdata(&cdev->dev), &tape_discipline_34xx ); } diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index c453b2f3e9f..5de27c9e4af 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c @@ -1703,7 +1703,7 @@ static struct ccw_device_id tape_3590_ids[] = { static int tape_3590_online(struct ccw_device *cdev) { - return tape_generic_online(cdev->dev.driver_data, + return tape_generic_online(dev_get_drvdata(&cdev->dev), &tape_discipline_3590); } diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index 8a109f3b69c..dfeb0d445fd 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -92,7 +92,7 @@ tape_medium_state_show(struct device *dev, struct device_attribute *attr, char * { struct tape_device *tdev; - tdev = (struct tape_device *) dev->driver_data; + tdev = dev_get_drvdata(dev); return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state); } @@ -104,7 +104,7 @@ tape_first_minor_show(struct device *dev, struct device_attribute *attr, char *b { struct tape_device *tdev; - tdev = (struct tape_device *) dev->driver_data; + tdev = dev_get_drvdata(dev); return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor); } @@ -116,7 +116,7 @@ tape_state_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tape_device *tdev; - tdev = (struct tape_device *) dev->driver_data; + tdev = dev_get_drvdata(dev); return scnprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ? "OFFLINE" : tape_state_verbose[tdev->tape_state]); } @@ -130,7 +130,7 @@ tape_operation_show(struct device *dev, struct device_attribute *attr, char *buf struct tape_device *tdev; ssize_t rc; - tdev = (struct tape_device *) dev->driver_data; + tdev = dev_get_drvdata(dev); if (tdev->first_minor < 0) return scnprintf(buf, PAGE_SIZE, "N/A\n"); @@ -156,7 +156,7 @@ tape_blocksize_show(struct device *dev, struct device_attribute *attr, char *buf { struct tape_device *tdev; - tdev = (struct tape_device *) dev->driver_data; + tdev = dev_get_drvdata(dev); return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size); } @@ -391,7 +391,7 @@ tape_generic_offline(struct ccw_device *cdev) { struct tape_device *device; - device = cdev->dev.driver_data; + device = dev_get_drvdata(&cdev->dev); if (!device) { return -ENODEV; } @@ -534,7 +534,7 @@ tape_generic_probe(struct ccw_device *cdev) tape_put_device(device); return ret; } - cdev->dev.driver_data = device; + dev_set_drvdata(&cdev->dev, device); cdev->handler = __tape_do_irq; device->cdev = cdev; ccw_device_get_id(cdev, &dev_id); @@ -573,7 +573,7 @@ tape_generic_remove(struct ccw_device *cdev) { struct tape_device * device; - device = cdev->dev.driver_data; + device = dev_get_drvdata(&cdev->dev); if (!device) { return; } @@ -613,9 +613,9 @@ tape_generic_remove(struct ccw_device *cdev) tape_cleanup_device(device); } - if (cdev->dev.driver_data != NULL) { + if (!dev_get_drvdata(&cdev->dev)) { sysfs_remove_group(&cdev->dev.kobj, &tape_attr_group); - cdev->dev.driver_data = tape_put_device(cdev->dev.driver_data); + dev_set_drvdata(&cdev->dev, tape_put_device(dev_get_drvdata(&cdev->dev))); } } @@ -1011,7 +1011,7 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) struct tape_request *request; int rc; - device = (struct tape_device *) cdev->dev.driver_data; + device = dev_get_drvdata(&cdev->dev); if (device == NULL) { return; } diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index d8a2289fcb6..ee1b418b0d8 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c @@ -504,7 +504,7 @@ static ssize_t vmlogrdr_autopurge_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) { - struct vmlogrdr_priv_t *priv = dev->driver_data; + struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); ssize_t ret = count; switch (buf[0]) { @@ -525,7 +525,7 @@ static ssize_t vmlogrdr_autopurge_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct vmlogrdr_priv_t *priv = dev->driver_data; + struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); return sprintf(buf, "%u\n", priv->autopurge); } @@ -541,7 +541,7 @@ static ssize_t vmlogrdr_purge_store(struct device * dev, char cp_command[80]; char cp_response[80]; - struct vmlogrdr_priv_t *priv = dev->driver_data; + struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); if (buf[0] != '1') return -EINVAL; @@ -578,7 +578,7 @@ static ssize_t vmlogrdr_autorecording_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct vmlogrdr_priv_t *priv = dev->driver_data; + struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); ssize_t ret = count; switch (buf[0]) { @@ -599,7 +599,7 @@ static ssize_t vmlogrdr_autorecording_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct vmlogrdr_priv_t *priv = dev->driver_data; + struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); return sprintf(buf, "%u\n", priv->autorecording); } @@ -612,7 +612,7 @@ static ssize_t vmlogrdr_recording_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) { - struct vmlogrdr_priv_t *priv = dev->driver_data; + struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); ssize_t ret; switch (buf[0]) { diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 5dcef81fc9d..6492b2015dd 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c @@ -78,11 +78,11 @@ static DEFINE_MUTEX(vmur_mutex); * * Each ur device (urd) contains a reference to its corresponding ccw device * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the - * ur device using the cdev->dev.driver_data pointer. + * ur device using dev_get_drvdata(&cdev->dev) pointer. * * urd references: * - ur_probe gets a urd reference, ur_remove drops the reference - * (cdev->dev.driver_data) + * dev_get_drvdata(&cdev->dev) * - ur_open gets a urd reference, ur_relase drops the reference * (urf->urd) * @@ -90,7 +90,7 @@ static DEFINE_MUTEX(vmur_mutex); * - urdev_alloc get a cdev reference (urd->cdev) * - urdev_free drops the cdev reference (urd->cdev) * - * Setting and clearing of cdev->dev.driver_data is protected by the ccwdev lock + * Setting and clearing of dev_get_drvdata(&cdev->dev) is protected by the ccwdev lock */ static struct urdev *urdev_alloc(struct ccw_device *cdev) { @@ -129,7 +129,7 @@ static struct urdev *urdev_get_from_cdev(struct ccw_device *cdev) unsigned long flags; spin_lock_irqsave(get_ccwdev_lock(cdev), flags); - urd = cdev->dev.driver_data; + urd = dev_get_drvdata(&cdev->dev); if (urd) urdev_get(urd); spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); @@ -286,7 +286,7 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm, TRACE("ur_int_handler: unsolicited interrupt\n"); return; } - urd = cdev->dev.driver_data; + urd = dev_get_drvdata(&cdev->dev); BUG_ON(!urd); /* On special conditions irb is an error pointer */ if (IS_ERR(irb)) @@ -832,7 +832,7 @@ static int ur_probe(struct ccw_device *cdev) goto fail_remove_attr; } spin_lock_irq(get_ccwdev_lock(cdev)); - cdev->dev.driver_data = urd; + dev_set_drvdata(&cdev->dev, urd); spin_unlock_irq(get_ccwdev_lock(cdev)); mutex_unlock(&vmur_mutex); @@ -972,8 +972,8 @@ static void ur_remove(struct ccw_device *cdev) ur_remove_attributes(&cdev->dev); spin_lock_irqsave(get_ccwdev_lock(cdev), flags); - urdev_put(cdev->dev.driver_data); - cdev->dev.driver_data = NULL; + urdev_put(dev_get_drvdata(&cdev->dev)); + dev_set_drvdata(&cdev->dev, NULL); spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); mutex_unlock(&vmur_mutex); diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 7b6f46ddf3c..1b34233cf6d 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -284,7 +284,7 @@ claw_probe(struct ccwgroup_device *cgdev) if (!get_device(&cgdev->dev)) return -ENODEV; privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); - cgdev->dev.driver_data = privptr; + dev_set_drvdata(&cgdev->dev, privptr); if (privptr == NULL) { probe_error(cgdev); put_device(&cgdev->dev); @@ -591,14 +591,14 @@ claw_irq_handler(struct ccw_device *cdev, CLAW_DBF_TEXT(4, trace, "clawirq"); /* Bypass all 'unsolicited interrupts' */ - if (!cdev->dev.driver_data) { + privptr = dev_get_drvdata(&cdev->dev); + if (!privptr) { dev_warn(&cdev->dev, "An uninitialized CLAW device received an" " IRQ, c-%02x d-%02x\n", irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); CLAW_DBF_TEXT(2, trace, "badirq"); return; } - privptr = (struct claw_privbk *)cdev->dev.driver_data; /* Try to extract channel from driver data. */ if (privptr->channel[READ].cdev == cdev) @@ -1980,9 +1980,9 @@ probe_error( struct ccwgroup_device *cgdev) struct claw_privbk *privptr; CLAW_DBF_TEXT(4, trace, "proberr"); - privptr = (struct claw_privbk *) cgdev->dev.driver_data; + privptr = dev_get_drvdata(&cgdev->dev); if (privptr != NULL) { - cgdev->dev.driver_data = NULL; + dev_set_drvdata(&cgdev->dev, NULL); kfree(privptr->p_env); kfree(privptr->p_mtc_envelope); kfree(privptr); @@ -2911,9 +2911,9 @@ claw_new_device(struct ccwgroup_device *cgdev) dev_info(&cgdev->dev, "add for %s\n", dev_name(&cgdev->cdev[READ]->dev)); CLAW_DBF_TEXT(2, setup, "new_dev"); - privptr = cgdev->dev.driver_data; - cgdev->cdev[READ]->dev.driver_data = privptr; - cgdev->cdev[WRITE]->dev.driver_data = privptr; + privptr = dev_get_drvdata(&cgdev->dev); + dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); + dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); if (!privptr) return -ENODEV; p_env = privptr->p_env; @@ -2950,9 +2950,9 @@ claw_new_device(struct ccwgroup_device *cgdev) goto out; } dev->ml_priv = privptr; - cgdev->dev.driver_data = privptr; - cgdev->cdev[READ]->dev.driver_data = privptr; - cgdev->cdev[WRITE]->dev.driver_data = privptr; + dev_set_drvdata(&cgdev->dev, privptr); + dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); + dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); /* sysfs magic */ SET_NETDEV_DEV(dev, &cgdev->dev); if (register_netdev(dev) != 0) { @@ -3018,7 +3018,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev) int ret; CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); - priv = cgdev->dev.driver_data; + priv = dev_get_drvdata(&cgdev->dev); if (!priv) return -ENODEV; ndev = priv->channel[READ].ndev; @@ -3048,7 +3048,7 @@ claw_remove_device(struct ccwgroup_device *cgdev) BUG_ON(!cgdev); CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); - priv = cgdev->dev.driver_data; + priv = dev_get_drvdata(&cgdev->dev); BUG_ON(!priv); dev_info(&cgdev->dev, " will be removed.\n"); if (cgdev->state == CCWGROUP_ONLINE) @@ -3063,9 +3063,9 @@ claw_remove_device(struct ccwgroup_device *cgdev) kfree(priv->channel[1].irb); priv->channel[1].irb=NULL; kfree(priv); - cgdev->dev.driver_data=NULL; - cgdev->cdev[READ]->dev.driver_data = NULL; - cgdev->cdev[WRITE]->dev.driver_data = NULL; + dev_set_drvdata(&cgdev->dev, NULL); + dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL); + dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL); put_device(&cgdev->dev); return; @@ -3081,7 +3081,7 @@ claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf) struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3095,7 +3095,7 @@ claw_hname_write(struct device *dev, struct device_attribute *attr, struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3119,7 +3119,7 @@ claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf) struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3133,7 +3133,7 @@ claw_adname_write(struct device *dev, struct device_attribute *attr, struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3157,7 +3157,7 @@ claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf) struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3172,7 +3172,7 @@ claw_apname_write(struct device *dev, struct device_attribute *attr, struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3206,7 +3206,7 @@ claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf) struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3221,7 +3221,7 @@ claw_wbuff_write(struct device *dev, struct device_attribute *attr, struct claw_env * p_env; int nnn,max; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3248,7 +3248,7 @@ claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf) struct claw_privbk *priv; struct claw_env * p_env; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; @@ -3263,7 +3263,7 @@ claw_rbuff_write(struct device *dev, struct device_attribute *attr, struct claw_env *p_env; int nnn,max; - priv = dev->driver_data; + priv = dev_get_drvdata(dev); if (!priv) return -ENODEV; p_env = priv->p_env; diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index a45bc24eb5f..ba6d45d29ad 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -1939,7 +1939,7 @@ lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf) { struct lcs_card *card; - card = (struct lcs_card *)dev->driver_data; + card = dev_get_drvdata(dev); if (!card) return 0; @@ -1956,7 +1956,7 @@ lcs_portno_store (struct device *dev, struct device_attribute *attr, const char struct lcs_card *card; int value; - card = (struct lcs_card *)dev->driver_data; + card = dev_get_drvdata(dev); if (!card) return 0; @@ -1990,7 +1990,7 @@ lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) { struct lcs_card *card; - card = (struct lcs_card *)dev->driver_data; + card = dev_get_drvdata(dev); return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0; } @@ -2001,7 +2001,7 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char struct lcs_card *card; int value; - card = (struct lcs_card *)dev->driver_data; + card = dev_get_drvdata(dev); if (!card) return 0; @@ -2020,7 +2020,7 @@ static ssize_t lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct lcs_card *card = dev->driver_data; + struct lcs_card *card = dev_get_drvdata(dev); char *tmp; int i; @@ -2073,7 +2073,7 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) put_device(&ccwgdev->dev); return ret; } - ccwgdev->dev.driver_data = card; + dev_set_drvdata(&ccwgdev->dev, card); ccwgdev->cdev[0]->handler = lcs_irq; ccwgdev->cdev[1]->handler = lcs_irq; card->gdev = ccwgdev; @@ -2090,7 +2090,7 @@ lcs_register_netdev(struct ccwgroup_device *ccwgdev) struct lcs_card *card; LCS_DBF_TEXT(2, setup, "regnetdv"); - card = (struct lcs_card *)ccwgdev->dev.driver_data; + card = dev_get_drvdata(&ccwgdev->dev); if (card->dev->reg_state != NETREG_UNINITIALIZED) return 0; SET_NETDEV_DEV(card->dev, &ccwgdev->dev); @@ -2123,7 +2123,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) enum lcs_dev_states recover_state; int rc; - card = (struct lcs_card *)ccwgdev->dev.driver_data; + card = dev_get_drvdata(&ccwgdev->dev); if (!card) return -ENODEV; @@ -2229,7 +2229,7 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) int ret; LCS_DBF_TEXT(3, setup, "shtdndev"); - card = (struct lcs_card *)ccwgdev->dev.driver_data; + card = dev_get_drvdata(&ccwgdev->dev); if (!card) return -ENODEV; if (recovery_mode == 0) { @@ -2296,7 +2296,7 @@ lcs_remove_device(struct ccwgroup_device *ccwgdev) { struct lcs_card *card; - card = (struct lcs_card *)ccwgdev->dev.driver_data; + card = dev_get_drvdata(&ccwgdev->dev); if (!card) return; diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index d58fea52557..6d668642af2 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h @@ -34,8 +34,8 @@ static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level) * sysfs related stuff */ #define CARD_FROM_DEV(cdev) \ - (struct lcs_card *) \ - ((struct ccwgroup_device *)cdev->dev.driver_data)->dev.driver_data; + (struct lcs_card *) dev_get_drvdata( \ + &((struct ccwgroup_device *)dev_get_drvdata(&cdev->dev))->dev); /** * CCW commands used in this driver */ diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index aec9e5d3cf4..d52a99f9b70 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -1364,7 +1364,7 @@ static int netiucv_change_mtu(struct net_device * dev, int new_mtu) static ssize_t user_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid)); @@ -1373,7 +1373,7 @@ static ssize_t user_show(struct device *dev, struct device_attribute *attr, static ssize_t user_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); struct net_device *ndev = priv->conn->netdev; char *p; char *tmp; @@ -1430,7 +1430,8 @@ static DEVICE_ATTR(user, 0644, user_show, user_write); static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, char *buf) -{ struct netiucv_priv *priv = dev->driver_data; +{ + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%d\n", priv->conn->max_buffsize); @@ -1439,7 +1440,7 @@ static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); struct net_device *ndev = priv->conn->netdev; char *e; int bs1; @@ -1487,7 +1488,7 @@ static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write); static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm)); @@ -1498,7 +1499,7 @@ static DEVICE_ATTR(device_fsm_state, 0444, dev_fsm_show, NULL); static ssize_t conn_fsm_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); @@ -1509,7 +1510,7 @@ static DEVICE_ATTR(connection_fsm_state, 0444, conn_fsm_show, NULL); static ssize_t maxmulti_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); @@ -1519,7 +1520,7 @@ static ssize_t maxmulti_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.maxmulti = 0; @@ -1531,7 +1532,7 @@ static DEVICE_ATTR(max_tx_buffer_used, 0644, maxmulti_show, maxmulti_write); static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); @@ -1540,7 +1541,7 @@ static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.maxcqueue = 0; @@ -1552,7 +1553,7 @@ static DEVICE_ATTR(max_chained_skbs, 0644, maxcq_show, maxcq_write); static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); @@ -1561,7 +1562,7 @@ static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.doios_single = 0; @@ -1573,7 +1574,7 @@ static DEVICE_ATTR(tx_single_write_ops, 0644, sdoio_show, sdoio_write); static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); @@ -1582,7 +1583,7 @@ static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); priv->conn->prof.doios_multi = 0; @@ -1594,7 +1595,7 @@ static DEVICE_ATTR(tx_multi_write_ops, 0644, mdoio_show, mdoio_write); static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.txlen); @@ -1603,7 +1604,7 @@ static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.txlen = 0; @@ -1615,7 +1616,7 @@ static DEVICE_ATTR(netto_bytes, 0644, txlen_show, txlen_write); static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); @@ -1624,7 +1625,7 @@ static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.tx_time = 0; @@ -1636,7 +1637,7 @@ static DEVICE_ATTR(max_tx_io_time, 0644, txtime_show, txtime_write); static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); @@ -1645,7 +1646,7 @@ static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, static ssize_t txpend_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.tx_pending = 0; @@ -1657,7 +1658,7 @@ static DEVICE_ATTR(tx_pending, 0644, txpend_show, txpend_write); static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, char *buf) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 5, __func__); return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); @@ -1666,7 +1667,7 @@ static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct netiucv_priv *priv = dev->driver_data; + struct netiucv_priv *priv = dev_get_drvdata(dev); IUCV_DBF_TEXT(trace, 4, __func__); priv->conn->prof.tx_max_pending = 0; @@ -1758,7 +1759,7 @@ static int netiucv_register_device(struct net_device *ndev) if (ret) goto out_unreg; priv->dev = dev; - dev->driver_data = priv; + dev_set_drvdata(dev, priv); return 0; out_unreg: -- cgit v1.2.3 From 5888fd30ac70fa50f08979c46f9206d01ca6ad49 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Tue, 5 May 2009 10:41:19 +0200 Subject: block/ps3: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Signed-off-by: Roel Kluin Acked-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- drivers/block/ps3disk.c | 18 +++++++++--------- drivers/block/ps3vram.c | 46 +++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'drivers') diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index aaeeb544228..1299db15f08 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -120,7 +120,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev, static int ps3disk_submit_request_sg(struct ps3_storage_device *dev, struct request *req) { - struct ps3disk_private *priv = dev->sbd.core.driver_data; + struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core); int write = rq_data_dir(req), res; const char *op = write ? "write" : "read"; u64 start_sector, sectors; @@ -168,7 +168,7 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev, static int ps3disk_submit_flush_request(struct ps3_storage_device *dev, struct request *req) { - struct ps3disk_private *priv = dev->sbd.core.driver_data; + struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core); u64 res; dev_dbg(&dev->sbd.core, "%s:%u: flush request\n", __func__, __LINE__); @@ -213,7 +213,7 @@ static void ps3disk_do_request(struct ps3_storage_device *dev, static void ps3disk_request(struct request_queue *q) { struct ps3_storage_device *dev = q->queuedata; - struct ps3disk_private *priv = dev->sbd.core.driver_data; + struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core); if (priv->req) { dev_dbg(&dev->sbd.core, "%s:%u busy\n", __func__, __LINE__); @@ -245,7 +245,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data) return IRQ_HANDLED; } - priv = dev->sbd.core.driver_data; + priv = dev_get_drvdata(&dev->sbd.core); req = priv->req; if (!req) { dev_dbg(&dev->sbd.core, @@ -364,7 +364,7 @@ static void ata_id_c_string(const u16 *id, unsigned char *s, unsigned int ofs, static int ps3disk_identify(struct ps3_storage_device *dev) { - struct ps3disk_private *priv = dev->sbd.core.driver_data; + struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core); struct lv1_ata_cmnd_block ata_cmnd; u16 *id = dev->bounce_buf; u64 res; @@ -445,7 +445,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) goto fail; } - dev->sbd.core.driver_data = priv; + dev_set_drvdata(&dev->sbd.core, priv); spin_lock_init(&priv->lock); dev->bounce_size = BOUNCE_SIZE; @@ -523,7 +523,7 @@ fail_free_bounce: kfree(dev->bounce_buf); fail_free_priv: kfree(priv); - dev->sbd.core.driver_data = NULL; + dev_set_drvdata(&dev->sbd.core, NULL); fail: mutex_lock(&ps3disk_mask_mutex); __clear_bit(devidx, &ps3disk_mask); @@ -534,7 +534,7 @@ fail: static int ps3disk_remove(struct ps3_system_bus_device *_dev) { struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core); - struct ps3disk_private *priv = dev->sbd.core.driver_data; + struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core); mutex_lock(&ps3disk_mask_mutex); __clear_bit(MINOR(disk_devt(priv->gendisk)) / PS3DISK_MINORS, @@ -548,7 +548,7 @@ static int ps3disk_remove(struct ps3_system_bus_device *_dev) ps3stor_teardown(dev); kfree(dev->bounce_buf); kfree(priv); - dev->sbd.core.driver_data = NULL; + dev_set_drvdata(&dev->sbd.core, NULL); return 0; } diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 8eddef373a9..8ecf1e00ced 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c @@ -111,7 +111,7 @@ static u32 *ps3vram_get_notifier(u32 *reports, int notifier) static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); int i; @@ -122,7 +122,7 @@ static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev) static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev, unsigned int timeout_ms) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms); @@ -137,7 +137,7 @@ static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev, static void ps3vram_init_ring(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET; priv->ctrl[CTRL_GET] = FIFO_BASE + FIFO_OFFSET; @@ -146,7 +146,7 @@ static void ps3vram_init_ring(struct ps3_system_bus_device *dev) static int ps3vram_wait_ring(struct ps3_system_bus_device *dev, unsigned int timeout_ms) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms); do { @@ -175,7 +175,7 @@ static void ps3vram_begin_ring(struct ps3vram_priv *priv, u32 chan, u32 tag, static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); int status; ps3vram_out_ring(priv, 0x20000000 | (FIFO_BASE + FIFO_OFFSET)); @@ -196,7 +196,7 @@ static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev) static void ps3vram_fire_ring(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); int status; mutex_lock(&ps3_gpu_mutex); @@ -225,7 +225,7 @@ static void ps3vram_fire_ring(struct ps3_system_bus_device *dev) static void ps3vram_bind(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0, 1); ps3vram_out_ring(priv, 0x31337303); @@ -248,7 +248,7 @@ static int ps3vram_upload(struct ps3_system_bus_device *dev, unsigned int src_offset, unsigned int dst_offset, int len, int count) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); ps3vram_begin_ring(priv, UPLOAD_SUBCH, NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8); @@ -280,7 +280,7 @@ static int ps3vram_download(struct ps3_system_bus_device *dev, unsigned int src_offset, unsigned int dst_offset, int len, int count) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8); @@ -310,7 +310,7 @@ static int ps3vram_download(struct ps3_system_bus_device *dev, static void ps3vram_cache_evict(struct ps3_system_bus_device *dev, int entry) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); struct ps3vram_cache *cache = &priv->cache; if (!(cache->tags[entry].flags & CACHE_PAGE_DIRTY)) @@ -332,7 +332,7 @@ static void ps3vram_cache_evict(struct ps3_system_bus_device *dev, int entry) static void ps3vram_cache_load(struct ps3_system_bus_device *dev, int entry, unsigned int address) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); struct ps3vram_cache *cache = &priv->cache; dev_dbg(&dev->core, "Fetching %d: 0x%08x\n", entry, address); @@ -352,7 +352,7 @@ static void ps3vram_cache_load(struct ps3_system_bus_device *dev, int entry, static void ps3vram_cache_flush(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); struct ps3vram_cache *cache = &priv->cache; int i; @@ -366,7 +366,7 @@ static void ps3vram_cache_flush(struct ps3_system_bus_device *dev) static unsigned int ps3vram_cache_match(struct ps3_system_bus_device *dev, loff_t address) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); struct ps3vram_cache *cache = &priv->cache; unsigned int base; unsigned int offset; @@ -400,7 +400,7 @@ static unsigned int ps3vram_cache_match(struct ps3_system_bus_device *dev, static int ps3vram_cache_init(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); priv->cache.page_count = CACHE_PAGE_COUNT; priv->cache.page_size = CACHE_PAGE_SIZE; @@ -419,7 +419,7 @@ static int ps3vram_cache_init(struct ps3_system_bus_device *dev) static void ps3vram_cache_cleanup(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); ps3vram_cache_flush(dev); kfree(priv->cache.tags); @@ -428,7 +428,7 @@ static void ps3vram_cache_cleanup(struct ps3_system_bus_device *dev) static int ps3vram_read(struct ps3_system_bus_device *dev, loff_t from, size_t len, size_t *retlen, u_char *buf) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); unsigned int cached, count; dev_dbg(&dev->core, "%s: from=0x%08x len=0x%zx\n", __func__, @@ -476,7 +476,7 @@ static int ps3vram_read(struct ps3_system_bus_device *dev, loff_t from, static int ps3vram_write(struct ps3_system_bus_device *dev, loff_t to, size_t len, size_t *retlen, const u_char *buf) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); unsigned int cached, count; if (to >= priv->size) @@ -543,7 +543,7 @@ static const struct file_operations ps3vram_proc_fops = { static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); struct proc_dir_entry *pde; pde = proc_create(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops); @@ -615,9 +615,9 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) } mutex_init(&priv->lock); - dev->core.driver_data = priv; + dev_set_drvdata(&dev->core, priv); - priv = dev->core.driver_data; + priv = dev_get_drvdata(&dev->core); /* Allocate XDR buffer (1MiB aligned) */ priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL, @@ -787,14 +787,14 @@ out_free_xdr_buf: free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE)); fail_free_priv: kfree(priv); - dev->core.driver_data = NULL; + dev_set_drvdata(&dev->core, NULL); fail: return error; } static int ps3vram_remove(struct ps3_system_bus_device *dev) { - struct ps3vram_priv *priv = dev->core.driver_data; + struct ps3vram_priv *priv = dev_get_drvdata(&dev->core); del_gendisk(priv->gendisk); put_disk(priv->gendisk); @@ -809,7 +809,7 @@ static int ps3vram_remove(struct ps3_system_bus_device *dev) ps3_close_hv_device(dev); free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE)); kfree(priv); - dev->core.driver_data = NULL; + dev_set_drvdata(&dev->core, NULL); return 0; } -- cgit v1.2.3 From 839214aeaae1866d55e745c676206825f8ba7e99 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: usb: gadget: at91_udc: remove driver_data direct access of struct device In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux-usb@vger.kernel.org Cc: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/at91_udc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 0b2bb8f0706..53bcdd2f828 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1574,7 +1574,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) udc->driver = driver; udc->gadget.dev.driver = &driver->driver; - udc->gadget.dev.driver_data = &driver->driver; + dev_set_drvdata(&udc->gadget.dev, &driver->driver); udc->enabled = 1; udc->selfpowered = 1; @@ -1583,7 +1583,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) DBG("driver->bind() returned %d\n", retval); udc->driver = NULL; udc->gadget.dev.driver = NULL; - udc->gadget.dev.driver_data = NULL; + dev_set_drvdata(&udc->gadget.dev, NULL); udc->enabled = 0; udc->selfpowered = 0; return retval; @@ -1613,7 +1613,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) driver->unbind(&udc->gadget); udc->gadget.dev.driver = NULL; - udc->gadget.dev.driver_data = NULL; + dev_set_drvdata(&udc->gadget.dev, NULL); udc->driver = NULL; DBG("unbound from %s\n", driver->driver.name); -- cgit v1.2.3 From 1b713e00500c6f03317742981674e89a21629399 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 May 2009 12:40:54 -0700 Subject: xen: remove driver_data direct access of struct device from more drivers In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: xen-devel@lists.xensource.com Cc: virtualization@lists.osdl.org Acked-by: Chris Wright Cc: Jeremy Fitzhardinge Signed-off-by: Greg Kroah-Hartman --- drivers/input/xen-kbdfront.c | 8 ++++---- drivers/net/xen-netfront.c | 10 +++++----- drivers/video/xen-fbfront.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index 928d2ed8865..b115726dc08 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c @@ -114,7 +114,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev, xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; } - dev->dev.driver_data = info; + dev_set_drvdata(&dev->dev, info); info->xbdev = dev; info->irq = -1; snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename); @@ -186,7 +186,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev, static int xenkbd_resume(struct xenbus_device *dev) { - struct xenkbd_info *info = dev->dev.driver_data; + struct xenkbd_info *info = dev_get_drvdata(&dev->dev); xenkbd_disconnect_backend(info); memset(info->page, 0, PAGE_SIZE); @@ -195,7 +195,7 @@ static int xenkbd_resume(struct xenbus_device *dev) static int xenkbd_remove(struct xenbus_device *dev) { - struct xenkbd_info *info = dev->dev.driver_data; + struct xenkbd_info *info = dev_get_drvdata(&dev->dev); xenkbd_disconnect_backend(info); if (info->kbd) @@ -266,7 +266,7 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info) static void xenkbd_backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state) { - struct xenkbd_info *info = dev->dev.driver_data; + struct xenkbd_info *info = dev_get_drvdata(&dev->dev); int ret, val; switch (backend_state) { diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index f6732538790..8d88daeed0c 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1212,7 +1212,7 @@ static int __devinit netfront_probe(struct xenbus_device *dev, } info = netdev_priv(netdev); - dev->dev.driver_data = info; + dev_set_drvdata(&dev->dev, info); err = register_netdev(info->netdev); if (err) { @@ -1233,7 +1233,7 @@ static int __devinit netfront_probe(struct xenbus_device *dev, fail: free_netdev(netdev); - dev->dev.driver_data = NULL; + dev_set_drvdata(&dev->dev, NULL); return err; } @@ -1275,7 +1275,7 @@ static void xennet_disconnect_backend(struct netfront_info *info) */ static int netfront_resume(struct xenbus_device *dev) { - struct netfront_info *info = dev->dev.driver_data; + struct netfront_info *info = dev_get_drvdata(&dev->dev); dev_dbg(&dev->dev, "%s\n", dev->nodename); @@ -1600,7 +1600,7 @@ static int xennet_connect(struct net_device *dev) static void backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state) { - struct netfront_info *np = dev->dev.driver_data; + struct netfront_info *np = dev_get_drvdata(&dev->dev); struct net_device *netdev = np->netdev; dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state)); @@ -1774,7 +1774,7 @@ static struct xenbus_device_id netfront_ids[] = { static int __devexit xennet_remove(struct xenbus_device *dev) { - struct netfront_info *info = dev->dev.driver_data; + struct netfront_info *info = dev_get_drvdata(&dev->dev); dev_dbg(&dev->dev, "%s\n", dev->nodename); diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 2493f05e9f6..15502d5e364 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c @@ -384,7 +384,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, fb_size = XENFB_DEFAULT_FB_LEN; } - dev->dev.driver_data = info; + dev_set_drvdata(&dev->dev, info); info->xbdev = dev; info->irq = -1; info->x1 = info->y1 = INT_MAX; @@ -503,7 +503,7 @@ xenfb_make_preferred_console(void) static int xenfb_resume(struct xenbus_device *dev) { - struct xenfb_info *info = dev->dev.driver_data; + struct xenfb_info *info = dev_get_drvdata(&dev->dev); xenfb_disconnect_backend(info); xenfb_init_shared_page(info, info->fb_info); @@ -512,7 +512,7 @@ static int xenfb_resume(struct xenbus_device *dev) static int xenfb_remove(struct xenbus_device *dev) { - struct xenfb_info *info = dev->dev.driver_data; + struct xenfb_info *info = dev_get_drvdata(&dev->dev); xenfb_disconnect_backend(info); if (info->fb_info) { @@ -621,7 +621,7 @@ static void xenfb_disconnect_backend(struct xenfb_info *info) static void xenfb_backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state) { - struct xenfb_info *info = dev->dev.driver_data; + struct xenfb_info *info = dev_get_drvdata(&dev->dev); int val; switch (backend_state) { -- cgit v1.2.3 From 156f5a7801195fa2ce44aeeb62d6cf8468f3332a Mon Sep 17 00:00:00 2001 From: GeunSik Lim Date: Tue, 2 Jun 2009 15:01:37 +0900 Subject: debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem. Many developers use "/debug/" or "/debugfs/" or "/sys/kernel/debug/" directory name to mount debugfs filesystem for ftrace according to ./Documentation/tracers/ftrace.txt file. And, three directory names(ex:/debug/, /debugfs/, /sys/kernel/debug/) is existed in kernel source like ftrace, DRM, Wireless, Documentation, Network[sky2]files to mount debugfs filesystem. debugfs means debug filesystem for debugging easy to use by greg kroah hartman. "/sys/kernel/debug/" name is suitable as directory name of debugfs filesystem. - debugfs related reference: http://lwn.net/Articles/334546/ Fix inconsistency of directory name to mount debugfs filesystem. * From Steven Rostedt - find_debugfs() and tracing_files() in this patch. Signed-off-by: GeunSik Lim Acked-by : Inaky Perez-Gonzalez Reviewed-by : Steven Rostedt Reviewed-by : James Smart CC: Jiri Kosina CC: David Airlie CC: Peter Osterlund CC: Ananth N Mavinakayanahalli CC: Anil S Keshavamurthy CC: Masami Hiramatsu Signed-off-by: Greg Kroah-Hartman --- drivers/block/pktcdvd.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 12 ++++++------ drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_stub.c | 2 +- drivers/net/Kconfig | 4 ++-- drivers/net/wimax/i2400m/i2400m.h | 2 +- drivers/net/wireless/ath/ath5k/Kconfig | 5 ++--- drivers/net/wireless/libertas/README | 12 ++++++------ drivers/scsi/lpfc/lpfc_debugfs.c | 3 +-- 9 files changed, 21 insertions(+), 23 deletions(-) (limited to 'drivers') diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 37e0f81cada..83650e00632 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -430,7 +430,7 @@ static void pkt_sysfs_cleanup(void) /******************************************************************** entries in debugfs - /debugfs/pktcdvd[0-7]/ + /sys/kernel/debug/pktcdvd[0-7]/ info *******************************************************************/ diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index c77c6c6d9d2..6ce0e2667a8 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -105,7 +105,7 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count, ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, root, tmp, &drm_debugfs_fops); if (!ent) { - DRM_ERROR("Cannot create /debugfs/dri/%s/%s\n", + DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s/%s\n", name, files[i].name); drm_free(tmp, sizeof(struct drm_info_node), _DRM_DRIVER); @@ -133,9 +133,9 @@ EXPORT_SYMBOL(drm_debugfs_create_files); * \param minor device minor number * \param root DRI debugfs dir entry. * - * Create the DRI debugfs root entry "/debugfs/dri", the device debugfs root entry - * "/debugfs/dri/%minor%/", and each entry in debugfs_list as - * "/debugfs/dri/%minor%/%name%". + * Create the DRI debugfs root entry "/sys/kernel/debug/dri", the device debugfs root entry + * "/sys/kernel/debug/dri/%minor%/", and each entry in debugfs_list as + * "/sys/kernel/debug/dri/%minor%/%name%". */ int drm_debugfs_init(struct drm_minor *minor, int minor_id, struct dentry *root) @@ -148,7 +148,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, sprintf(name, "%d", minor_id); minor->debugfs_root = debugfs_create_dir(name, root); if (!minor->debugfs_root) { - DRM_ERROR("Cannot create /debugfs/dri/%s\n", name); + DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s\n", name); return -1; } @@ -165,7 +165,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, ret = dev->driver->debugfs_init(minor); if (ret) { DRM_ERROR("DRM: Driver failed to initialize " - "/debugfs/dri.\n"); + "/sys/kernel/debug/dri.\n"); return ret; } } diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 019b7c57823..1bf7efd8d33 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -339,7 +339,7 @@ static int __init drm_core_init(void) drm_debugfs_root = debugfs_create_dir("dri", NULL); if (!drm_debugfs_root) { - DRM_ERROR("Cannot create /debugfs/dri\n"); + DRM_ERROR("Cannot create /sys/kernel/debug/dri\n"); ret = -1; goto err_p3; } diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 89050684fe0..387a8de1bc7 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -343,7 +343,7 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int t #if defined(CONFIG_DEBUG_FS) ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root); if (ret) { - DRM_ERROR("DRM: Failed to initialize /debugfs/dri.\n"); + DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); goto err_g2; } #endif diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 01f282cd098..3b6383168c6 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -2206,7 +2206,7 @@ config SKGE_DEBUG depends on SKGE && DEBUG_FS help This option adds the ability to dump driver state for debugging. - The file debugfs/skge/ethX displays the state of the internal + The file /sys/kernel/debug/skge/ethX displays the state of the internal transmit and receive rings. If unsure, say N. @@ -2232,7 +2232,7 @@ config SKY2_DEBUG depends on SKY2 && DEBUG_FS help This option adds the ability to dump driver state for debugging. - The file debugfs/sky2/ethX displays the state of the internal + The file /sys/kernel/debug/sky2/ethX displays the state of the internal transmit and receive rings. If unsure, say N. diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index 1fe5da4cf0a..60330f313f2 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h @@ -432,7 +432,7 @@ struct i2400m { unsigned ready:1; /* all probing steps done */ unsigned rx_reorder:1; /* RX reorder is enabled */ u8 trace_msg_from_user; /* echo rx msgs to 'trace' pipe */ - /* typed u8 so debugfs/u8 can tweak */ + /* typed u8 so /sys/kernel/debug/u8 can tweak */ enum i2400m_system_state state; wait_queue_head_t state_wq; /* Woken up when on state updates */ diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig index 509b6f94f73..daf0c83527d 100644 --- a/drivers/net/wireless/ath/ath5k/Kconfig +++ b/drivers/net/wireless/ath/ath5k/Kconfig @@ -28,11 +28,10 @@ config ATH5K_DEBUG Say Y, if and you will get debug options for ath5k. To use this, you need to mount debugfs: - mkdir /debug/ - mount -t debugfs debug /debug/ + mount -t debugfs debug /sys/kernel/debug You will get access to files under: - /debug/ath5k/phy0/ + /sys/kernel/debug/ath5k/phy0/ To enable debug, pass the debug level to the debug module parameter. For example: diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README index d860fc37575..ab6a2d518af 100644 --- a/drivers/net/wireless/libertas/README +++ b/drivers/net/wireless/libertas/README @@ -72,7 +72,7 @@ rdrf location that is to be read. This parameter must be specified in hexadecimal (its possible to preceed preceding the number with a "0x"). - Path: /debugfs/libertas_wireless/ethX/registers/ + Path: /sys/kernel/debug/libertas_wireless/ethX/registers/ Usage: echo "0xa123" > rdmac ; cat rdmac @@ -95,7 +95,7 @@ wrrf sleepparams This command is used to set the sleepclock configurations - Path: /debugfs/libertas_wireless/ethX/ + Path: /sys/kernel/debug/libertas_wireless/ethX/ Usage: cat sleepparams: reads the current sleepclock configuration @@ -115,7 +115,7 @@ subscribed_events The subscribed_events directory contains the interface for the subscribed events API. - Path: /debugfs/libertas_wireless/ethX/subscribed_events/ + Path: /sys/kernel/debug/libertas_wireless/ethX/subscribed_events/ Each event is represented by a filename. Each filename consists of the following three fields: @@ -165,7 +165,7 @@ subscribed_events extscan This command is used to do a specific scan. - Path: /debugfs/libertas_wireless/ethX/ + Path: /sys/kernel/debug/libertas_wireless/ethX/ Usage: echo "SSID" > extscan @@ -179,7 +179,7 @@ getscantable Display the current contents of the driver scan table (ie. get the scan results). - Path: /debugfs/libertas_wireless/ethX/ + Path: /sys/kernel/debug/libertas_wireless/ethX/ Usage: cat getscantable @@ -188,7 +188,7 @@ setuserscan Initiate a customized scan and retrieve the results - Path: /debugfs/libertas_wireless/ethX/ + Path: /sys/kernel/debug/libertas_wireless/ethX/ Usage: echo "[ARGS]" > setuserscan diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 2b02b1fb39a..8d0f0de76b6 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -53,8 +53,7 @@ * debugfs interface * * To access this interface the user should: - * # mkdir /debug - * # mount -t debugfs none /debug + * # mount -t debugfs none /sys/kernel/debug * * The lpfc debugfs directory hierarchy is: * lpfc/lpfcX/vportY -- cgit v1.2.3