[patch] i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code

2015-08-18 Thread Dan Carpenter
The dma_mapping_error() function returns true if there is an error, it doesn't return an error code. We should return -ENOMEM. Signed-off-by: Dan Carpenter diff --git a/drivers/i2c/busses/i2c-xgene-slimpro.c b/drivers/i2c/busses/i2c-xgene-slimpro.c index 1c9cb65a..4233f56 100644 --- a/dr

Re: [PATCH 1/4] parport: modify parport subsystem to use devicemodel

2015-04-15 Thread Dan Carpenter
etails). > it will be done in free_port() the release callback of parport device. That doesn't work. Some of the callers pass a string literal. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.

Re: [PATCH 1/4] parport: modify parport subsystem to use devicemodel

2015-04-15 Thread Dan Carpenter
he condition will always be true. The question of how to handle impossible conditions is always tricky. :P In this case just remove the condition. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord..

Re: [PATCH 1/4] parport: modify parport subsystem to use devicemodel

2015-04-15 Thread Dan Carpenter
tween parport_register_device() and parport_register_dev() isn't clear from the name. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/4] parport: modify parport subsystem to use devicemodel

2015-04-15 Thread Dan Carpenter
ce = parport_default_timeslice; > + tmp->waitnext = NULL; > + tmp->waitprev = NULL; > + > + /* > + * This has to be run as last thing since init_state may need other > + * pardevice fields. -arca > + */ > + port->ops->init_state(tmp, tmp->stat

Re: [PATCH 01/14] parport: return value of attach and parport_register_driver

2015-04-08 Thread Dan Carpenter
On Wed, Apr 08, 2015 at 05:20:10PM +0530, Sudip Mukherjee wrote: > On Wed, Apr 08, 2015 at 02:38:32PM +0300, Dan Carpenter wrote: > > 1) We can't apply this patch on its own so this way of breaking up the > > patches doesn't work. > yes, if the first patch is reverted f

Re: [PATCH 01/14] parport: return value of attach and parport_register_driver

2015-04-08 Thread Dan Carpenter
On Wed, Apr 08, 2015 at 02:38:32PM +0300, Dan Carpenter wrote: > 1) We can't apply this patch on its own so this way of breaking up the > patches doesn't work. > The right thing is to do add an attach_ret(). static int do_attach(drv) { if (drv->attach_ret)

Re: [PATCH 01/14] parport: return value of attach and parport_register_driver

2015-04-08 Thread Dan Carpenter
y much. But I can also see your point. Hm... Minor comment: No need to preserve the error code if there are lots which we miss. We may as well hard code an error code. But that's a minor thing. Does this actually simplify the driver code? That's the more important thing. r

[iio:testing 25/25] drivers/iio/magnetometer/ak09911.c:301 ak09911_probe() error: we previously assumed 'id' could be null (see line 288)

2014-06-16 Thread Dan Carpenter
ak09911_probe() is called from i2c_device_probe() when we do: status = driver->probe(client, i2c_match_id(driver->id_table, client)); The functions which implement driver->probe() are not very consistent in how the check for a NULL return from i2c_match_id(). tree: git://git.kernel.org

[patch] i2c: qup: off by ones in qup_i2c_probe()

2014-04-03 Thread Dan Carpenter
These should ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()". Fixes: 10c5a8425968 ('i2c: qup: New bus driver for the Qualcomm QUP I2C controller') Signed-off-by: Dan Carpenter diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index c9d5f

re: i2c: nomadik: Convert to devm functions

2014-04-02 Thread Dan Carpenter
returns a NULL on error the same as ioremap() does. 1003 ret = -ENOMEM; 1004 goto err_no_mem; 1005 } 1006 1007 dev->irq = adev->irq[0]; regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe li

re: i2c: pxa: add OF support

2013-11-06 Thread Dan Carpenter
^^^ Null dereferences. Obviously the unwind needs to be fixed so it's a mirror reflection of the allocation order. Also the labels are crap. Label names should be based on the label location and not the goto location(s). 1273 return ret; 1274 } regards, dan carpenter -- To un

Re: [patch] i2c-scmi: remove some bogus NULL checks

2013-10-30 Thread Dan Carpenter
ch was that some compilers assume pointer math can't overflow and my checker was complaining. We use -fno-strict-overflow in the kernel, but it still seemed worth cleaning. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] i2c-scmi: remove some bogus NULL checks

2013-10-19 Thread Dan Carpenter
"obj" can't be NULL here. We already know that "pkg->package.elements" gives us a valid pointer so the next pointer after that is also non-NULL. Signed-off-by: Dan Carpenter diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c index c447e8d..

Re: [PATCH RESEND v2] i2c-eg20t: support new device OKI SEMICONDUCTOR ML7213 IOH

2011-02-28 Thread Dan Carpenter
I think goto err_request_irq was intended here. On a side note, it's always better to name goto destinations after the destination instead of the starting point. In this case, we have two gotos to one destination and the label err_request_irq makes no sense. regards, dan carpenter -- To un

[patch] i2c: off by one issue

2010-04-07 Thread Dan Carpenter
If we don't find the correct rate, we want to end the loop with "i" pointing to the last element in the array. Signed-off-by: Dan Carpenter --- I will be offline for a while, sorry if I delay replying. diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.