Re: [PATCH v3 3/4] leds: pca955x: add GPIO support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi!

> >>>> +static u8 pca955x_read_input(struct i2c_client *client, int n)
> >>>> +{
> >>>> +	return (u8)i2c_smbus_read_byte_data(client, n);
> >>>> +}
> >>>
> >>> Is the cast needed? Should you attempt to handle errors?
> >>
> >> ah. this is a left over. I can fix in a resend.
> > 
> > No need to resend just for this.
> > 
> > Should you WARN_ON() if the read_byte_data returns < 0 or something?
> > 
> > https://linuxtv.org/downloads/v4l-dvb-internals/device-drivers/API-i2c-smbus-read-byte-data.html
> 
> I don't think so as this is just to read the gpio value. 
> 
> I suppose that the i2c layer will output some errors before 
> if it catches some invalid state.

Normally its driver's job to output errors. (Same for write).

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux