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
This commit is contained in:
commit
a4dc32374e
9 changed files with 27 additions and 19 deletions
|
@ -207,8 +207,8 @@ Attributes
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
struct driver_attribute {
|
struct driver_attribute {
|
||||||
struct attribute attr;
|
struct attribute attr;
|
||||||
ssize_t (*show)(struct device_driver *, char * buf, size_t count, loff_t off);
|
ssize_t (*show)(struct device_driver *driver, char *buf);
|
||||||
ssize_t (*store)(struct device_driver *, const char * buf, size_t count, loff_t off);
|
ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
|
||||||
};
|
};
|
||||||
|
|
||||||
Device drivers can export attributes via their sysfs directories.
|
Device drivers can export attributes via their sysfs directories.
|
||||||
|
|
|
@ -224,7 +224,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
|
||||||
if (!strcmp(type, "domain-services-port"))
|
if (!strcmp(type, "domain-services-port"))
|
||||||
bus_id_name = "ds";
|
bus_id_name = "ds";
|
||||||
|
|
||||||
if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) {
|
/*
|
||||||
|
* 20 char is the old driver-core name size limit, which is no more.
|
||||||
|
* This check can probably be removed after review and possible
|
||||||
|
* adaption of the vio users name length handling.
|
||||||
|
*/
|
||||||
|
if (strlen(bus_id_name) >= 20 - 4) {
|
||||||
printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
|
printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
|
||||||
bus_id_name);
|
bus_id_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -428,6 +428,9 @@ int devres_release_all(struct device *dev)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
/* Looks like an uninitialized device structure */
|
||||||
|
if (WARN_ON(dev->devres_head.next == NULL))
|
||||||
|
return -ENODEV;
|
||||||
spin_lock_irqsave(&dev->devres_lock, flags);
|
spin_lock_irqsave(&dev->devres_lock, flags);
|
||||||
return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
|
return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
|
||||||
flags);
|
flags);
|
||||||
|
|
|
@ -217,8 +217,10 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr,
|
||||||
ret_count = -ENODEV;
|
ret_count = -ENODEV;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (offset > fw->size)
|
if (offset > fw->size) {
|
||||||
return 0;
|
ret_count = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
if (count > fw->size - offset)
|
if (count > fw->size - offset)
|
||||||
count = fw->size - offset;
|
count = fw->size - offset;
|
||||||
|
|
||||||
|
|
|
@ -33,14 +33,14 @@ static enum power_supply_property *prop;
|
||||||
|
|
||||||
static unsigned long wm97xx_read_bat(struct power_supply *bat_ps)
|
static unsigned long wm97xx_read_bat(struct power_supply *bat_ps)
|
||||||
{
|
{
|
||||||
return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data,
|
return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
|
||||||
pdata->batt_aux) * pdata->batt_mult /
|
pdata->batt_aux) * pdata->batt_mult /
|
||||||
pdata->batt_div;
|
pdata->batt_div;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long wm97xx_read_temp(struct power_supply *bat_ps)
|
static unsigned long wm97xx_read_temp(struct power_supply *bat_ps)
|
||||||
{
|
{
|
||||||
return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data,
|
return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
|
||||||
pdata->temp_aux) * pdata->temp_mult /
|
pdata->temp_aux) * pdata->temp_mult /
|
||||||
pdata->temp_div;
|
pdata->temp_div;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1254,7 +1254,7 @@ static struct fb_ops omapfb_ops = {
|
||||||
static ssize_t omapfb_show_caps_num(struct device *dev,
|
static ssize_t omapfb_show_caps_num(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
int plane;
|
int plane;
|
||||||
size_t size;
|
size_t size;
|
||||||
struct omapfb_caps caps;
|
struct omapfb_caps caps;
|
||||||
|
@ -1274,7 +1274,7 @@ static ssize_t omapfb_show_caps_num(struct device *dev,
|
||||||
static ssize_t omapfb_show_caps_text(struct device *dev,
|
static ssize_t omapfb_show_caps_text(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
int i;
|
int i;
|
||||||
struct omapfb_caps caps;
|
struct omapfb_caps caps;
|
||||||
int plane;
|
int plane;
|
||||||
|
@ -1321,7 +1321,7 @@ static DEVICE_ATTR(caps_text, 0444, omapfb_show_caps_text, NULL);
|
||||||
static ssize_t omapfb_show_panel_name(struct device *dev,
|
static ssize_t omapfb_show_panel_name(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
|
return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
|
||||||
}
|
}
|
||||||
|
@ -1330,7 +1330,7 @@ static ssize_t omapfb_show_bklight_level(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (fbdev->panel->get_bklight_level) {
|
if (fbdev->panel->get_bklight_level) {
|
||||||
|
@ -1345,7 +1345,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t size)
|
const char *buf, size_t size)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (fbdev->panel->set_bklight_level) {
|
if (fbdev->panel->set_bklight_level) {
|
||||||
|
@ -1364,7 +1364,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
|
||||||
static ssize_t omapfb_show_bklight_max(struct device *dev,
|
static ssize_t omapfb_show_bklight_max(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (fbdev->panel->get_bklight_level) {
|
if (fbdev->panel->get_bklight_level) {
|
||||||
|
@ -1397,7 +1397,7 @@ static struct attribute_group panel_attr_grp = {
|
||||||
static ssize_t omapfb_show_ctrl_name(struct device *dev,
|
static ssize_t omapfb_show_ctrl_name(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data;
|
struct omapfb_device *fbdev = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name);
|
return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -436,7 +436,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
|
||||||
rcu_assign_pointer(ptbl->part[partno], p);
|
rcu_assign_pointer(ptbl->part[partno], p);
|
||||||
|
|
||||||
/* suppress uevent if the disk supresses it */
|
/* suppress uevent if the disk supresses it */
|
||||||
if (!dev_get_uevent_suppress(pdev))
|
if (!dev_get_uevent_suppress(ddev))
|
||||||
kobject_uevent(&pdev->kobj, KOBJ_ADD);
|
kobject_uevent(&pdev->kobj, KOBJ_ADD);
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
#include <asm/device.h>
|
#include <asm/device.h>
|
||||||
|
|
||||||
#define BUS_ID_SIZE 20
|
|
||||||
|
|
||||||
struct device;
|
struct device;
|
||||||
struct device_private;
|
struct device_private;
|
||||||
struct device_driver;
|
struct device_driver;
|
||||||
|
|
|
@ -1037,14 +1037,14 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
|
||||||
codec->control_data = spi;
|
codec->control_data = spi;
|
||||||
codec->dev = &spi->dev;
|
codec->dev = &spi->dev;
|
||||||
|
|
||||||
spi->dev.driver_data = wm8988;
|
dev_set_drvdata(&spi->dev, wm8988);
|
||||||
|
|
||||||
return wm8988_register(wm8988);
|
return wm8988_register(wm8988);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devexit wm8988_spi_remove(struct spi_device *spi)
|
static int __devexit wm8988_spi_remove(struct spi_device *spi)
|
||||||
{
|
{
|
||||||
struct wm8988_priv *wm8988 = spi->dev.driver_data;
|
struct wm8988_priv *wm8988 = dev_get_drvdata(&spi->dev);
|
||||||
|
|
||||||
wm8988_unregister(wm8988);
|
wm8988_unregister(wm8988);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue