From: InKi Dae <daeinki@gmail.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
"linux-fbdev-devel@lists.sourceforge.net"
<linux-fbdev-devel@lists.sourceforge.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Pavel Machek <pavel@ucw.cz>
Subject: Re: [Linux-fbdev-devel] [PATCH] added S6E63M0 AMOLED LCD Panel driver.
Date: Wed, 31 Mar 2010 11:56:50 +0900 [thread overview]
Message-ID: <90b950fc1003301956mf8246f4sd060852dbead1407@mail.gmail.com> (raw)
In-Reply-To: <0D753D10438DA54287A00B027084269763691C3440@AUSP01VMBX24.collaborationhost.net>
Hi Hertley,
it's a good way.
this way is more clear and also Andrew's concern could be solved.
I'd like to apply it to local repository and then I will send the patch
in the near future.
and Andrew, If you think that Hertley's way is clear then I would make
the patch. maybe it would become second patch.
Thank you.
2010/3/31 H Hartley Sweeten <hartleys@visionengravers.com>:
> On Tuesday, March 30, 2010 4:03 PM, Andrew Morton wrote:
>> On Fri, 26 Mar 2010 12:24:24 +0900
>> InKi Dae <daeinki@gmail.com> wrote:
>>
>>> +static int s6e63m0_ldi_init(struct s6e63m0 *lcd)
>>> +{
>>> + int ret;
>>> +
>>> + ret = s6e63m0_panel_send_sequence(lcd, SEQ_PANEL_CONDITION_SET);
>>> + ret |= s6e63m0_panel_send_sequence(lcd, SEQ_DISPLAY_CONDITION_SET);
>>> + ret |= s6e63m0_panel_send_sequence(lcd, SEQ_GAMMA_SETTING);
>>> + ret |= s6e63m0_panel_send_sequence(lcd, SEQ_ETC_CONDITION_SET);
>>> + ret |= s6e63m0_panel_send_sequence(lcd, SEQ_ACL_ON);
>>> + ret |= s6e63m0_panel_send_sequence(lcd, SEQ_ELVSS_ON);
>>> +
>>> + return ret;
>>> +}
>>
>> Well. If one call to s6e63m0_panel_send_sequence() returns -ENOMEM and
>> another call returns -EIO (for example), this function will return some
>> other, incorrect errno.
>>
>> Which is a rather minor problem, unless some caller is explicitly
>> looking for some particular error code, which doesn't happen often.
>
> Why not handle the calls with a loop?
>
> +static int s6e63m0_ldi_init(struct s6e63m0 *lcd)
> +{
> + const unsigned short *init_seq[] = {
> + SEQ_PANEL_CONDITION_SET,
> + SEQ_DISPLAY_CONDITION_SET,
> + SEQ_GAMMA_SETTING,
> + SEQ_ETC_CONDITION_SET,
> + SEQ_ACL_ON,
> + SEQ_ELVSS_ON,
> + };
> + int i, ret;
> +
> + for (i = 0; i < ARRAY_SIZE(init_seq); i++) {
> + ret = s6e63m0_panel_send_sequence(lcd, init_seq[i]);
> + if (ret)
> + break;
> + }
> + return ret;
> +}
>
> Note that _s6e63m0_gamma_ctl has the same issue. Actually, the whole
> driver has issues with returning errors properly.
>
> Regards,
> Hartley
next prev parent reply other threads:[~2010-03-31 2:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-26 3:24 [PATCH] added S6E63M0 AMOLED LCD Panel driver InKi Dae
2010-03-30 23:02 ` Andrew Morton
2010-03-30 23:24 ` [Linux-fbdev-devel] " H Hartley Sweeten
2010-03-31 2:56 ` InKi Dae [this message]
2010-03-31 2:41 ` InKi Dae
2010-03-30 23:55 ` Andrew Morton
2010-04-27 19:05 ` Andrew Morton
2010-04-29 3:30 ` InKi Dae
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=90b950fc1003301956mf8246f4sd060852dbead1407@mail.gmail.com \
--to=daeinki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hartleys@visionengravers.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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).