Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324566
b: refs/heads/master
c: 1021bb5
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Aug 16, 2012
1 parent f6094fd commit 40ef34b
Show file tree
Hide file tree
Showing 31 changed files with 683 additions and 538 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc2c90c974a0ed390327bbd94f49269e9f24e280
refs/heads/master: 1021bb5c62a13b05242bbfdc8a5a241025dad883
21 changes: 10 additions & 11 deletions trunk/drivers/staging/asus_oled/asus_oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
#define ASUS_OLED_NAME "asus-oled"
#define ASUS_OLED_UNDERSCORE_NAME "asus_oled"

#define ASUS_OLED_ERROR "Asus OLED Display Error: "

#define ASUS_OLED_STATIC 's'
#define ASUS_OLED_ROLL 'r'
#define ASUS_OLED_FLASH 'f'
Expand All @@ -57,8 +55,9 @@
#define USB_DEVICE_ID_ASUS_LCM2 0x175b

MODULE_AUTHOR("Jakub Schmidtke, sjakub@gmail.com");
MODULE_DESCRIPTION("Asus OLED Driver v" ASUS_OLED_VERSION);
MODULE_DESCRIPTION("Asus OLED Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(ASUS_OLED_VERSION);

static struct class *oled_class;
static int oled_num;
Expand Down Expand Up @@ -383,13 +382,13 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)

default:
i = 0;
printk(ASUS_OLED_ERROR "Unknown OLED Pack Mode: %d!\n",
dev_err(odev->dev, "Unknown OLED Pack Mode: %d!\n",
odev->pack_mode);
break;
}

if (i >= odev->buf_size) {
printk(ASUS_OLED_ERROR "Buffer overflow! Report a bug:"
dev_err(odev->dev, "Buffer overflow! Report a bug:"
"offs: %d >= %d i: %d (x: %d y: %d)\n",
(int) odev->buf_offs, (int) odev->buf_size,
(int) i, (int) x, (int) y);
Expand Down Expand Up @@ -435,7 +434,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev,
odev->buf = kmalloc(odev->buf_size, GFP_KERNEL);
if (odev->buf == NULL) {
odev->buf_size = 0;
printk(ASUS_OLED_ERROR "Out of memory!\n");
dev_err(odev->dev, "Out of memory!\n");
return -ENOMEM;
}

Expand Down Expand Up @@ -473,7 +472,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev,
odev->pic_mode = buf[1];
break;
default:
printk(ASUS_OLED_ERROR "Wrong picture mode: '%c'.\n",
dev_err(odev->dev, "Wrong picture mode: '%c'.\n",
buf[1]);
return -EIO;
break;
Expand Down Expand Up @@ -533,7 +532,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev,

if (odev->buf == NULL) {
odev->buf_size = 0;
printk(ASUS_OLED_ERROR "Out of memory!\n");
dev_err(odev->dev, "Out of memory!\n");
return -ENOMEM;
}

Expand Down Expand Up @@ -593,15 +592,15 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev,
return count;

error_width:
printk(ASUS_OLED_ERROR "Wrong picture width specified.\n");
dev_err(odev->dev, "Wrong picture width specified.\n");
return -EIO;

error_height:
printk(ASUS_OLED_ERROR "Wrong picture height specified.\n");
dev_err(odev->dev, "Wrong picture height specified.\n");
return -EIO;

error_header:
printk(ASUS_OLED_ERROR "Wrong picture header.\n");
dev_err(odev->dev, "Wrong picture header.\n");
return -EIO;
}

Expand Down
37 changes: 14 additions & 23 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,14 +882,12 @@ static int check_insn_config_length(struct comedi_insn *insn,
/* by default we allow the insn since we don't have checks for
* all possible cases yet */
default:
printk(KERN_WARNING
"comedi: no check for data length of config insn id "
"%i is implemented.\n"
" Add a check to %s in %s.\n"
" Assuming n=%i is correct.\n", data[0], __func__,
__FILE__, insn->n);
pr_warn("comedi: No check for data length of config insn id %i is implemented.\n",
data[0]);
pr_warn("comedi: Add a check to %s in %s.\n",
__func__, __FILE__);
pr_warn("comedi: Assuming n=%i is correct.\n", insn->n);
return 0;
break;
}
return -EINVAL;
}
Expand Down Expand Up @@ -2034,8 +2032,8 @@ void do_become_nonbusy(struct comedi_device *dev, struct comedi_subdevice *s)
comedi_reset_async_buf(async);
async->inttrig = NULL;
} else {
printk(KERN_ERR
"BUG: (?) do_become_nonbusy called with async=0\n");
dev_err(dev->class_dev,
"BUG: (?) do_become_nonbusy called with async=NULL\n");
}

s->busy = NULL;
Expand Down Expand Up @@ -2211,14 +2209,12 @@ static int __init comedi_init(void)
int i;
int retval;

printk(KERN_INFO "comedi: version " COMEDI_RELEASE
" - http://www.comedi.org\n");
pr_info("comedi: version " COMEDI_RELEASE " - http://www.comedi.org\n");

if (comedi_num_legacy_minors < 0 ||
comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
printk(KERN_ERR "comedi: error: invalid value for module "
"parameter \"comedi_num_legacy_minors\". Valid values "
"are 0 through %i.\n", COMEDI_NUM_BOARD_MINORS);
pr_err("comedi: error: invalid value for module parameter \"comedi_num_legacy_minors\". Valid values are 0 through %i.\n",
COMEDI_NUM_BOARD_MINORS);
return -EINVAL;
}

Expand Down Expand Up @@ -2247,7 +2243,7 @@ static int __init comedi_init(void)
}
comedi_class = class_create(THIS_MODULE, "comedi");
if (IS_ERR(comedi_class)) {
printk(KERN_ERR "comedi: failed to create class");
pr_err("comedi: failed to create class\n");
cdev_del(&comedi_cdev);
unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
COMEDI_NUM_MINORS);
Expand Down Expand Up @@ -2295,8 +2291,7 @@ module_exit(comedi_cleanup);

void comedi_error(const struct comedi_device *dev, const char *s)
{
printk(KERN_ERR "comedi%d: %s: %s\n", dev->minor,
dev->driver->driver_name, s);
dev_err(dev->class_dev, "%s: %s\n", dev->driver->driver_name, s);
}
EXPORT_SYMBOL(comedi_error);

Expand Down Expand Up @@ -2420,9 +2415,7 @@ int comedi_alloc_board_minor(struct device *hardware_device)
comedi_device_cleanup(info->device);
kfree(info->device);
kfree(info);
printk(KERN_ERR
"comedi: error: "
"ran out of minor numbers for board device files.\n");
pr_err("comedi: error: ran out of minor numbers for board device files.\n");
return -EBUSY;
}
info->device->minor = i;
Expand Down Expand Up @@ -2499,9 +2492,7 @@ int comedi_alloc_subdevice_minor(struct comedi_device *dev,
spin_unlock(&comedi_file_info_table_lock);
if (i == COMEDI_NUM_MINORS) {
kfree(info);
printk(KERN_ERR
"comedi: error: "
"ran out of minor numbers for board device files.\n");
pr_err("comedi: error: ran out of minor numbers for board device files.\n");
return -EBUSY;
}
s->minor = i;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#define DPRINTK(format, args...) do { \
if (comedi_debug) \
printk(KERN_DEBUG "comedi: " format , ## args); \
pr_debug("comedi: " format, ## args); \
} while (0)

#define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
Expand Down
69 changes: 40 additions & 29 deletions trunk/drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ static void __comedi_device_detach(struct comedi_device *dev)
if (dev->driver)
dev->driver->detach(dev);
else
printk(KERN_WARNING
"BUG: dev->driver=NULL in comedi_device_detach()\n");
dev_warn(dev->class_dev,
"BUG: dev->driver=NULL in comedi_device_detach()\n");
cleanup_device(dev);
}

Expand All @@ -142,8 +142,7 @@ static int comedi_device_postconfig(struct comedi_device *dev)
return ret;
}
if (!dev->board_name) {
printk(KERN_WARNING "BUG: dev->board_name=<%p>\n",
dev->board_name);
dev_warn(dev->class_dev, "BUG: dev->board_name=NULL\n");
dev->board_name = "BUG";
}
smp_wmb();
Expand All @@ -161,7 +160,6 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)

for (driv = comedi_drivers; driv; driv = driv->next) {
if (!try_module_get(driv->module)) {
printk(KERN_INFO "comedi: failed to increment module count, skipping\n");
continue;
}
if (driv->num_names) {
Expand All @@ -177,15 +175,21 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* report valid board names before returning error */
for (driv = comedi_drivers; driv; driv = driv->next) {
if (!try_module_get(driv->module)) {
printk(KERN_INFO
"comedi: failed to increment module count\n");
continue;
}
comedi_report_boards(driv);
module_put(driv->module);
}
return -EIO;
}
if (driv->attach == NULL) {
/* driver does not support manual configuration */
dev_warn(dev->class_dev,
"driver '%s' does not support attach using comedi_config\n",
driv->driver_name);
module_put(driv->module);
return -ENOSYS;
}
/* initialize dev->driver here so
* comedi_error() can be called from attach */
dev->driver = driv;
Expand Down Expand Up @@ -225,8 +229,9 @@ int comedi_driver_unregister(struct comedi_driver *driver)
mutex_lock(&dev->mutex);
if (dev->attached && dev->driver == driver) {
if (dev->use_count)
printk(KERN_WARNING "BUG! detaching device with use_count=%d\n",
dev->use_count);
dev_warn(dev->class_dev,
"BUG! detaching device with use_count=%d\n",
dev->use_count);
comedi_device_detach(dev);
}
mutex_unlock(&dev->mutex);
Expand Down Expand Up @@ -273,8 +278,8 @@ static int postconfig(struct comedi_device *dev)
async =
kzalloc(sizeof(struct comedi_async), GFP_KERNEL);
if (async == NULL) {
printk(KERN_INFO
"failed to allocate async struct\n");
dev_warn(dev->class_dev,
"failed to allocate async struct\n");
return -ENOMEM;
}
init_waitqueue_head(&async->wait_head);
Expand All @@ -290,7 +295,8 @@ static int postconfig(struct comedi_device *dev)
async->prealloc_buf = NULL;
async->prealloc_bufsz = 0;
if (comedi_buf_alloc(dev, s, buf_size) < 0) {
printk(KERN_INFO "Buffer allocation failed\n");
dev_warn(dev->class_dev,
"Buffer allocation failed\n");
return -ENOMEM;
}
if (s->buf_change) {
Expand Down Expand Up @@ -370,17 +376,17 @@ static void comedi_report_boards(struct comedi_driver *driv)
unsigned int i;
const char *const *name_ptr;

printk(KERN_INFO "comedi: valid board names for %s driver are:\n",
driv->driver_name);
pr_info("comedi: valid board names for %s driver are:\n",
driv->driver_name);

name_ptr = driv->board_name;
for (i = 0; i < driv->num_names; i++) {
printk(KERN_INFO " %s\n", *name_ptr);
pr_info(" %s\n", *name_ptr);
name_ptr = (const char **)((char *)name_ptr + driv->offset);
}

if (driv->num_names == 0)
printk(KERN_INFO " %s\n", driv->driver_name);
pr_info(" %s\n", driv->driver_name);
}

static int poll_invalid(struct comedi_device *dev, struct comedi_subdevice *s)
Expand Down Expand Up @@ -584,9 +590,9 @@ static unsigned int comedi_buf_munge(struct comedi_async *async,

block_size = num_bytes - count;
if (block_size < 0) {
printk(KERN_WARNING
"%s: %s: bug! block_size is negative\n",
__FILE__, __func__);
dev_warn(s->device->class_dev,
"%s: %s: bug! block_size is negative\n",
__FILE__, __func__);
break;
}
if ((int)(async->munge_ptr + block_size -
Expand Down Expand Up @@ -667,7 +673,8 @@ unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes)
{
if ((int)(async->buf_write_count + nbytes -
async->buf_write_alloc_count) > 0) {
printk(KERN_INFO "comedi: attempted to write-free more bytes than have been write-allocated.\n");
dev_info(async->subdevice->device->class_dev,
"attempted to write-free more bytes than have been write-allocated.\n");
nbytes = async->buf_write_alloc_count - async->buf_write_count;
}
async->buf_write_count += nbytes;
Expand Down Expand Up @@ -703,8 +710,8 @@ unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes)
smp_mb();
if ((int)(async->buf_read_count + nbytes -
async->buf_read_alloc_count) > 0) {
printk(KERN_INFO
"comedi: attempted to read-free more bytes than have been read-allocated.\n");
dev_info(async->subdevice->device->class_dev,
"attempted to read-free more bytes than have been read-allocated.\n");
nbytes = async->buf_read_alloc_count - async->buf_read_count;
}
async->buf_read_count += nbytes;
Expand Down Expand Up @@ -853,10 +860,9 @@ comedi_auto_config_helper(struct device *hardware_device,
mutex_lock(&comedi_dev->mutex);
if (comedi_dev->attached)
ret = -EBUSY;
else if (!try_module_get(driver->module)) {
printk(KERN_INFO "comedi: failed to increment module count\n");
else if (!try_module_get(driver->module))
ret = -EIO;
} else {
else {
/* set comedi_dev->driver here for attach wrapper */
comedi_dev->driver = driver;
ret = (*attach_wrapper)(comedi_dev, context);
Expand Down Expand Up @@ -884,14 +890,19 @@ static int comedi_auto_config_wrapper(struct comedi_device *dev, void *context)
* has already been copied to it->board_name */
dev->board_ptr = comedi_recognize(driv, it->board_name);
if (dev->board_ptr == NULL) {
printk(KERN_WARNING
"comedi: auto config failed to find board entry"
" '%s' for driver '%s'\n", it->board_name,
driv->driver_name);
dev_warn(dev->class_dev,
"auto config failed to find board entry '%s' for driver '%s'\n",
it->board_name, driv->driver_name);
comedi_report_boards(driv);
return -EINVAL;
}
}
if (!driv->attach) {
dev_warn(dev->class_dev,
"BUG! driver '%s' using old-style auto config but has no attach handler\n",
driv->driver_name);
return -EINVAL;
}
return driv->attach(dev, it);
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/comedi/drivers/adl_pci7x3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static int adl_pci7x3x_do_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
unsigned int reg = (unsigned int)s->private;
unsigned long reg = (unsigned long)s->private;
unsigned int mask = data[0];
unsigned int bits = data[1];

Expand All @@ -147,7 +147,7 @@ static int adl_pci7x3x_di_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
unsigned int reg = (unsigned int)s->private;
unsigned long reg = (unsigned long)s->private;

data[1] = inl(dev->iobase + reg);

Expand Down
Loading

0 comments on commit 40ef34b

Please sign in to comment.