[PATCH v2] staging: olpc_dcon: ->read_status() API change

Dan Carpenter dan.carpenter at oracle.com
Fri Dec 2 20:40:45 UTC 2011


On Thu, Dec 01, 2011 at 10:55:05PM -0800, Andres Salomon wrote:
> > --- a/drivers/staging/olpc_dcon/olpc_dcon.c
> > +++ b/drivers/staging/olpc_dcon/olpc_dcon.c
> > @@ -755,9 +755,9 @@ static int dcon_resume(struct i2c_client *client)
> >  irqreturn_t dcon_interrupt(int irq, void *id)
> >  {
> >  	struct dcon_priv *dcon = id;
> > -	int status = pdata->read_status();
> > +	u8 status;
> >  
> > -	if (status == -1)
> > +	if (pdata->read_status(&status) == -1)
> >  		return IRQ_NONE;

It would be better to do a check for < 0 instead of -1 or even just
a check for non-zero.

	if (pdata->read_status(&status))
		return IRQ_NONE;

That's more linux-ish.

regards,
dan carpenter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20111202/2130d432/attachment.asc>


More information about the devel mailing list