aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-07-13 13:24:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-07-13 13:24:08 -0400
commita4dc32374ed6dd56e09039ea8b7151c3a3e2307d (patch)
treec1a5482db418ff1adb0135ac9d3abd01d138c2ad
parent51feb98d2547a389be2f666514f5bcd658f79eab (diff)
parent38c7dc373029e4666b17850054dd43c1c96bb264 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: wm97xx_batery: replace driver_data with dev_get_drvdata() omap: video: remove direct access of driver_data Sound: remove direct access of driver_data driver model: fix show/store prototypes in doc. Firmware: firmware_class, fix lock imbalance Driver Core: remove BUS_ID_SIZE sparc: remove driver-core BUS_ID_SIZE partitions: fix broken uevent_suppress conversion devres: WARN() and return, don't crash on device_del() of uninitialized device
-rw-r--r--Documentation/driver-model/driver.txt4
-rw-r--r--arch/sparc/kernel/vio.c7
-rw-r--r--drivers/base/devres.c3
-rw-r--r--drivers/base/firmware_class.c6
-rw-r--r--drivers/power/wm97xx_battery.c4
-rw-r--r--drivers/video/omap/omapfb_main.c14
-rw-r--r--fs/partitions/check.c2
-rw-r--r--include/linux/device.h2
-rw-r--r--sound/soc/codecs/wm8988.c4
9 files changed, 27 insertions, 19 deletions
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index 82132169d47a..60120fb3b961 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -207,8 +207,8 @@ Attributes
207~~~~~~~~~~ 207~~~~~~~~~~
208struct driver_attribute { 208struct driver_attribute {
209 struct attribute attr; 209 struct attribute attr;
210 ssize_t (*show)(struct device_driver *, char * buf, size_t count, loff_t off); 210 ssize_t (*show)(struct device_driver *driver, char *buf);
211 ssize_t (*store)(struct device_driver *, const char * buf, size_t count, loff_t off); 211 ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
212}; 212};
213 213
214Device drivers can export attributes via their sysfs directories. 214Device drivers can export attributes via their sysfs directories.
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 753d128ed158..c28c71449a6c 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -224,7 +224,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
224 if (!strcmp(type, "domain-services-port")) 224 if (!strcmp(type, "domain-services-port"))
225 bus_id_name = "ds"; 225 bus_id_name = "ds";
226 226
227 if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) { 227 /*
228 * 20 char is the old driver-core name size limit, which is no more.
229 * This check can probably be removed after review and possible
230 * adaption of the vio users name length handling.
231 */
232 if (strlen(bus_id_name) >= 20 - 4) {
228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n", 233 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
229 bus_id_name); 234 bus_id_name);
230 return NULL; 235 return NULL;
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index e8beb8e5b626..05dd307e8f02 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -428,6 +428,9 @@ int devres_release_all(struct device *dev)
428{ 428{
429 unsigned long flags; 429 unsigned long flags;
430 430
431 /* Looks like an uninitialized device structure */
432 if (WARN_ON(dev->devres_head.next == NULL))
433 return -ENODEV;
431 spin_lock_irqsave(&dev->devres_lock, flags); 434 spin_lock_irqsave(&dev->devres_lock, flags);
432 return release_nodes(dev, dev->devres_head.next, &dev->devres_head, 435 return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
433 flags); 436 flags);
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index fc466531260e..f285f441fab9 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -217,8 +217,10 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr,
217 ret_count = -ENODEV; 217 ret_count = -ENODEV;
218 goto out; 218 goto out;
219 } 219 }
220 if (offset > fw->size) 220 if (offset > fw->size) {
221 return 0; 221 ret_count = 0;
222 goto out;
223 }
222 if (count > fw->size - offset) 224 if (count > fw->size - offset)
223 count = fw->size - offset; 225 count = fw->size - offset;
224 226
diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c
index 8bde92126d34..b787335a8419 100644
--- a/drivers/power/wm97xx_battery.c
+++ b/drivers/power/wm97xx_battery.c
@@ -33,14 +33,14 @@ static enum power_supply_property *prop;
33 33
34static unsigned long wm97xx_read_bat(struct power_supply *bat_ps) 34static unsigned long wm97xx_read_bat(struct power_supply *bat_ps)
35{ 35{
36 return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data, 36 return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
37 pdata->batt_aux) * pdata->batt_mult / 37 pdata->batt_aux) * pdata->batt_mult /
38 pdata->batt_div; 38 pdata->batt_div;
39} 39}
40 40
41static unsigned long wm97xx_read_temp(struct power_supply *bat_ps) 41static unsigned long wm97xx_read_temp(struct power_supply *bat_ps)
42{ 42{
43 return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data, 43 return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
44 pdata->temp_aux) * pdata->temp_mult / 44 pdata->temp_aux) * pdata->temp_mult /
45 pdata->temp_div; 45 pdata->temp_div;
46} 46}
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 4ea99bfc37b4..8862233d57b6 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1254,7 +1254,7 @@ static struct fb_ops omapfb_ops = {
1254static ssize_t omapfb_show_caps_num(struct device *dev, 1254static ssize_t omapfb_show_caps_num(struct device *dev,
1255 struct device_attribute *attr, char *buf) 1255 struct device_attribute *attr, char *buf)
1256{ 1256{
1257 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1257 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1258 int plane; 1258 int plane;
1259 size_t size; 1259 size_t size;
1260 struct omapfb_caps caps; 1260 struct omapfb_caps caps;
@@ -1274,7 +1274,7 @@ static ssize_t omapfb_show_caps_num(struct device *dev,
1274static ssize_t omapfb_show_caps_text(struct device *dev, 1274static ssize_t omapfb_show_caps_text(struct device *dev,
1275 struct device_attribute *attr, char *buf) 1275 struct device_attribute *attr, char *buf)
1276{ 1276{
1277 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1277 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1278 int i; 1278 int i;
1279 struct omapfb_caps caps; 1279 struct omapfb_caps caps;
1280 int plane; 1280 int plane;
@@ -1321,7 +1321,7 @@ static DEVICE_ATTR(caps_text, 0444, omapfb_show_caps_text, NULL);
1321static ssize_t omapfb_show_panel_name(struct device *dev, 1321static ssize_t omapfb_show_panel_name(struct device *dev,
1322 struct device_attribute *attr, char *buf) 1322 struct device_attribute *attr, char *buf)
1323{ 1323{
1324 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1324 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1325 1325
1326 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name); 1326 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
1327} 1327}
@@ -1330,7 +1330,7 @@ static ssize_t omapfb_show_bklight_level(struct device *dev,
1330 struct device_attribute *attr, 1330 struct device_attribute *attr,
1331 char *buf) 1331 char *buf)
1332{ 1332{
1333 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1333 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1334 int r; 1334 int r;
1335 1335
1336 if (fbdev->panel->get_bklight_level) { 1336 if (fbdev->panel->get_bklight_level) {
@@ -1345,7 +1345,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
1345 struct device_attribute *attr, 1345 struct device_attribute *attr,
1346 const char *buf, size_t size) 1346 const char *buf, size_t size)
1347{ 1347{
1348 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1348 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1349 int r; 1349 int r;
1350 1350
1351 if (fbdev->panel->set_bklight_level) { 1351 if (fbdev->panel->set_bklight_level) {
@@ -1364,7 +1364,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
1364static ssize_t omapfb_show_bklight_max(struct device *dev, 1364static ssize_t omapfb_show_bklight_max(struct device *dev,
1365 struct device_attribute *attr, char *buf) 1365 struct device_attribute *attr, char *buf)
1366{ 1366{
1367 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1367 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1368 int r; 1368 int r;
1369 1369
1370 if (fbdev->panel->get_bklight_level) { 1370 if (fbdev->panel->get_bklight_level) {
@@ -1397,7 +1397,7 @@ static struct attribute_group panel_attr_grp = {
1397static ssize_t omapfb_show_ctrl_name(struct device *dev, 1397static ssize_t omapfb_show_ctrl_name(struct device *dev,
1398 struct device_attribute *attr, char *buf) 1398 struct device_attribute *attr, char *buf)
1399{ 1399{
1400 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1400 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1401 1401
1402 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name); 1402 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name);
1403} 1403}
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 1a9c7878f864..ea4e6cb29e13 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -436,7 +436,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
436 rcu_assign_pointer(ptbl->part[partno], p); 436 rcu_assign_pointer(ptbl->part[partno], p);
437 437
438 /* suppress uevent if the disk supresses it */ 438 /* suppress uevent if the disk supresses it */
439 if (!dev_get_uevent_suppress(pdev)) 439 if (!dev_get_uevent_suppress(ddev))
440 kobject_uevent(&pdev->kobj, KOBJ_ADD); 440 kobject_uevent(&pdev->kobj, KOBJ_ADD);
441 441
442 return p; 442 return p;
diff --git a/include/linux/device.h b/include/linux/device.h
index ed4e39f2c423..aebb81036db2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -25,8 +25,6 @@
25#include <asm/atomic.h> 25#include <asm/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
27 27
28#define BUS_ID_SIZE 20
29
30struct device; 28struct device;
31struct device_private; 29struct device_private;
32struct device_driver; 30struct device_driver;
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index c05f71803aa8..8c0fdf84aac3 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -1037,14 +1037,14 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
1037 codec->control_data = spi; 1037 codec->control_data = spi;
1038 codec->dev = &spi->dev; 1038 codec->dev = &spi->dev;
1039 1039
1040 spi->dev.driver_data = wm8988; 1040 dev_set_drvdata(&spi->dev, wm8988);
1041 1041
1042 return wm8988_register(wm8988); 1042 return wm8988_register(wm8988);
1043} 1043}
1044 1044
1045static int __devexit wm8988_spi_remove(struct spi_device *spi) 1045static int __devexit wm8988_spi_remove(struct spi_device *spi)
1046{ 1046{
1047 struct wm8988_priv *wm8988 = spi->dev.driver_data; 1047 struct wm8988_priv *wm8988 = dev_get_drvdata(&spi->dev);
1048 1048
1049 wm8988_unregister(wm8988); 1049 wm8988_unregister(wm8988);
1050 1050