[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAVeFuKWoom82aMmPipkeqeAoNfz35bNTOs3deoYeNXZ0jq0cQ@mail.gmail.com>
Date: Wed, 7 May 2014 17:39:13 +0900
From: Alexandre Courbot <gnurou@...il.com>
To: Thierry Reding <thierry.reding@...il.com>
Cc: Alexandre Courbot <acourbot@...dia.com>,
Jingoo Han <jg1.han@...sung.com>,
Bryan Wu <cooloney@...il.com>, Ben Dooks <ben-linux@...ff.org>,
Kukjin Kim <kgene.kim@...sung.com>,
"linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] pwm-backlight: switch to gpiod interface
On Wed, May 7, 2014 at 5:18 PM, Thierry Reding <thierry.reding@...il.com> wrote:
> On Thu, Feb 27, 2014 at 02:53:34PM +0900, Alexandre Courbot wrote:
>> Switch to the new gpiod interface, which allows to handle GPIO
>> properties such as active low transparently and removes a whole bunch of
>> code.
>>
>> There are still a couple of users of this driver that rely on passing
>> the enable GPIO number through platform data, so a fallback mechanism
>> using a GPIO number is still available to avoid breaking them. It will
>> be removed once current users have switched to the GPIO lookup tables
>> provided by the gpiod interface.
>>
>> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
>> ---
>> drivers/video/backlight/pwm_bl.c | 72 +++++++++++++++++-----------------------
>> include/linux/pwm_backlight.h | 5 +--
>> 2 files changed, 32 insertions(+), 45 deletions(-)
>
> I've applied this with two tiny changes, see below. Please shout if you
> think that's a bad idea.
I'm fine with both changes. Thanks for picking these two guys!
Alex.
>
>> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> [...]
>> @@ -256,8 +238,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> [...]
>> + pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable");
>> + if (IS_ERR(pb->enable_gpio)) {
>> + ret = PTR_ERR(pb->enable_gpio);
>> + if (ret == -ENOENT) {
>> + pb->enable_gpio = NULL;
>> + ret = 0;
>> + } else {
>> + goto err_alloc;
>> + }
>
> I dropped the ret = 0 here because all error paths set it explicitly and
> the non-error path never uses it. Now all branches have a single
> statement and therefore the braces can be dropped.
>
>> + /*
>> + * Compatibility fallback for drivers still using the integer GPIO
>> + * platform data. Must go away soon.
>> + */
>> + if (pb->enable_gpio == NULL && gpio_is_valid(data->enable_gpio)) {
>
> Changed the first condition to !pb->enable_gpio for consistency.
>
> Thierry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists