Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp112765ybp; Thu, 3 Oct 2019 10:57:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU9QNhmvOZMWjliUVjsLHgoY+u14imko2yaagd0VvKnPk6JKI863ZIHhg96+ZSrTnMvQN2 X-Received: by 2002:a05:6402:1855:: with SMTP id v21mr3094199edy.242.1570125453888; Thu, 03 Oct 2019 10:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570125453; cv=none; d=google.com; s=arc-20160816; b=utMKCWp8jerU8ojy8C99BCKjnYiADjkSBnDDwMYabu1bZ3ATbbRxhWHvoS5f7Oxr7n ruBEImqqHBIsPFYjDsj2YWijzPKMEOa767B9tyE1dw4Jz8cEKe5lWMKRx+/AyFIbfSul JaBgoceXV2zC/WU+AE1I0CrsFsGaNICxKsNUSFrHEX+H0saYG4MnHoQ4zcvUysnMdnZe DVnD3agA/flPDPWFBZDNSoYTbPk4NY5TroyV8U/OjgU/tPm6EgnTLg498bhXiwm9+m6J m9YPi+JE46dtLEw+U5BoPqvR0w2n571CFJNp/V9uAfxsZgkhGoMtenH9+O4PjDj4MVDa 7tkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=iWtSBJKe76nynGhnxiOJ2Lg3nCj737L2QbGyJus8OHE=; b=YJOaVtXjCYJGuTMKwDVt7qtGs6T+KeKlg+CAXOgVPbHCB8vaNT/GpZfBi3XShxHg0c MfquSeFMlNiNukjShpxigDVWHSsYKY01xFN5pDl65ThzwCbMXdQZPPc008AGc/S5gRsc qvF9t6/gNRaYec5biEULgqc/MJw4C0lEhxV4uA7RT6+o4eFsclkbb5kLvbdwoQ3UhkkL aMk82rifh3OMQXiLhIcJhNhg4c17poW7JonuBHdmX7B5qL+6DtrIk10LV5luFyoj+LNW 2opzSR+h8/Hg9zLSd6X5ftLfT3btv8iCkr8L2+HLae9WTtzHcl0v9qe2aZ3GDzxNaMaB IudA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ata+h7vn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si1632749ejj.40.2019.10.03.10.57.07; Thu, 03 Oct 2019 10:57:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ata+h7vn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731240AbfJCRav (ORCPT + 99 others); Thu, 3 Oct 2019 13:30:51 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:36674 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730028AbfJCRaq (ORCPT ); Thu, 3 Oct 2019 13:30:46 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x93HNef8050113; Thu, 3 Oct 2019 12:23:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570123420; bh=iWtSBJKe76nynGhnxiOJ2Lg3nCj737L2QbGyJus8OHE=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=Ata+h7vnlts4aIRPksMFgleVPIt3OELkhLgzkSJT8AwEhjMkDFV3VLBW5frWbZhz8 9lLeYzkW7QmilsFkhY2SrY9ih7FUzt6UJwlSPQwIuu5o2od2B5BS6t6GR5Xpu8irGT 65j/0TSJeoEC6x49nwjVjNyMTvWFbp0UCFhaznEM= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x93HNdRh005634 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Oct 2019 12:23:39 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 3 Oct 2019 12:23:39 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 3 Oct 2019 12:23:28 -0500 Received: from [10.250.99.146] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x93HNbUm045560; Thu, 3 Oct 2019 12:23:37 -0500 Subject: Re: [PATCH v8 5/5] backlight: add led-backlight driver To: Sebastian Reichel CC: , , , , , , , , , , References: <20191003082812.28491-1-jjhiblot@ti.com> <20191003082812.28491-6-jjhiblot@ti.com> <20191003114735.byayntpe35qqrjeu@earth.universe> From: Jean-Jacques Hiblot Message-ID: <074963ce-d28f-413a-f35c-d503589a4604@ti.com> Date: Thu, 3 Oct 2019 19:23:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191003114735.byayntpe35qqrjeu@earth.universe> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sebastian, On 03/10/2019 13:47, Sebastian Reichel wrote: > Hi, > > On Thu, Oct 03, 2019 at 10:28:12AM +0200, Jean-Jacques Hiblot wrote: >> From: Tomi Valkeinen >> >> This patch adds a led-backlight driver (led_bl), which is similar to >> pwm_bl except the driver uses a LED class driver to adjust the >> brightness in the HW. Multiple LEDs can be used for a single backlight. >> >> Signed-off-by: Tomi Valkeinen >> Signed-off-by: Jean-Jacques Hiblot >> Acked-by: Pavel Machek >> Reviewed-by: Daniel Thompson >> --- > Reviewed-by: Sebastian Reichel > > (with some suggestions below) [...] > I suggest to restructure: > > 1. call led_sysfs_disable > > 2. use devm_add_action_or_reset() to register the > led_sysfs_enable loop > > 3. use devm_backlight_device_register() to register BL > > 4. drop the remove function > >> + >> + backlight_update_status(priv->bl_dev); >> + >> + return 0; >> +} >> + >> +static int led_bl_remove(struct platform_device *pdev) >> +{ >> + struct led_bl_data *priv = platform_get_drvdata(pdev); >> + struct backlight_device *bl = priv->bl_dev; >> + int i; >> + >> + backlight_device_unregister(bl); >> + >> + led_bl_power_off(priv); >> + for (i = 0; i < priv->nb_leds; i++) >> + led_sysfs_enable(priv->leds[i]); >> + >> + return 0; >> +} >> + >> +static const struct of_device_id led_bl_of_match[] = { >> + { .compatible = "led-backlight" }, >> + { } >> +}; >> + >> +MODULE_DEVICE_TABLE(of, led_bl_of_match); >> + >> +static struct platform_driver led_bl_driver = { >> + .driver = { >> + .name = "led-backlight", >> + .of_match_table = of_match_ptr(led_bl_of_match), > You should drop of_match_ptr(). Since the driver depends on OF, > it will always simply return led_bl_of_match. > > (Also after removing the OF dependency from the driver it would > either require led_bl_of_match to be marked __maybe_unused or > moving it into a #if CONFIG_OF area to avoid warnings.) Thanks for the suggestions. I think I'll work on them as a separate thing and post them after this is merged if there are no others changes required. JJ > > -- Sebastian > >> + }, >> + .probe = led_bl_probe, >> + .remove = led_bl_remove, >> +}; >> + >> +module_platform_driver(led_bl_driver); >> + >> +MODULE_DESCRIPTION("LED based Backlight Driver"); >> +MODULE_LICENSE("GPL"); >> +MODULE_ALIAS("platform:led-backlight"); >> -- >> 2.17.1 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel