devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: linux-leds@vger.kernel.org, Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Joel Stanley <joel@jms.id.au>
Subject: Re: [PATCH v3 3/4] leds: pca955x: add GPIO support
Date: Sat, 12 Aug 2017 10:42:13 +0200	[thread overview]
Message-ID: <20170812084213.GA20383@amd> (raw)
In-Reply-To: <b585f234-6ad6-e63f-f4ec-f7d1efaf83ca@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-08-12  8:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 13:42 [PATCH v3 0/4] leds: pca955x: add GPIO support Cédric Le Goater
     [not found] ` <1502199760-763-1-git-send-email-clg-Bxea+6Xhats@public.gmane.org>
2017-08-08 13:42   ` [PATCH v3 1/4] leds: pca955x: add device tree support Cédric Le Goater
2017-08-08 13:42   ` [PATCH v3 3/4] leds: pca955x: add GPIO support Cédric Le Goater
2017-08-11 13:47     ` Pavel Machek
2017-08-11 15:11       ` Cédric Le Goater
     [not found]         ` <9330f31a-110c-8398-8cd1-764f8dd358e9-Bxea+6Xhats@public.gmane.org>
2017-08-11 15:37           ` Pavel Machek
2017-08-11 16:26             ` Cédric Le Goater
2017-08-12  8:42               ` Pavel Machek [this message]
2017-08-24 11:30                 ` Cédric Le Goater
2017-08-24 20:03                   ` Jacek Anaszewski
     [not found]                     ` <c403ddf1-a26c-1ccc-f722-eacac6115c34-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-24 21:32                       ` Cédric Le Goater
2017-08-08 13:42 ` [PATCH v3 2/4] leds: pca955x: use devm_led_classdev_register Cédric Le Goater
2017-08-08 13:42 ` [PATCH v3 4/4] dt-bindings leds: add pca955x Cédric Le Goater
2017-08-14 20:28 ` [PATCH v3 0/4] leds: pca955x: add GPIO support Jacek Anaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170812084213.GA20383@amd \
    --to=pavel@ucw.cz \
    --cc=clg@kaod.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=joel@jms.id.au \
    --cc=linus.walleij@linaro.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).