From: "Andrew F. Davis" <afd@ti.com> To: Dan Murphy <dmurphy@ti.com>, robh+dt@kernel.org, mark.rutland@arm.com, jacek.anaszewski@gmail.com, pavel@ucw.cz Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v4 2/2] leds: lm3601x: Introduce the lm3601x LED driver Date: Thu, 10 May 2018 09:31:39 -0500 [thread overview] Message-ID: <7832225b-115c-2316-025e-29929cd4f208@ti.com> (raw) In-Reply-To: <08526618-7463-1e6e-a4ac-c4da4627c1b2@ti.com> On 05/10/2018 09:04 AM, Dan Murphy wrote: >>> +static int lm3601x_remove(struct i2c_client *client) >>> +{ >>> + struct lm3601x_led *led = i2c_get_clientdata(client); >>> + >>> + regmap_write(led->regmap, LM3601X_ENABLE_REG, 0); >>> + >> >> >> If probe doesn't enable this, remove shouldn't disable it. It can lead >> to odd cases if the driver is removed and added again. > > I want to make sure the LED is off and in standby mode. Maybe I will just set it to > the default value instead. > Why? If you want to do this then implement PM controls and put it in standby mode there. >> >> Plus, removing the driver is not a command to disable the LED anyway. > > True but you don't want to leave any LEDs in the on state without a driver to support it. > This could burn out the LED or the board if left on on max brightness > I disagree, we should not try to decide what the user wants here. We should only do what we are instructed to do, which for remove() is to cleanup what probe has done so the driver can be removed w/o leaking memory or device state. > > Dan >
WARNING: multiple messages have this Message-ID (diff)
From: "Andrew F. Davis" <afd@ti.com> To: Dan Murphy <dmurphy@ti.com>, <robh+dt@kernel.org>, <mark.rutland@arm.com>, <jacek.anaszewski@gmail.com>, <pavel@ucw.cz> Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-leds@vger.kernel.org> Subject: Re: [PATCH v4 2/2] leds: lm3601x: Introduce the lm3601x LED driver Date: Thu, 10 May 2018 09:31:39 -0500 [thread overview] Message-ID: <7832225b-115c-2316-025e-29929cd4f208@ti.com> (raw) In-Reply-To: <08526618-7463-1e6e-a4ac-c4da4627c1b2@ti.com> On 05/10/2018 09:04 AM, Dan Murphy wrote: >>> +static int lm3601x_remove(struct i2c_client *client) >>> +{ >>> + struct lm3601x_led *led = i2c_get_clientdata(client); >>> + >>> + regmap_write(led->regmap, LM3601X_ENABLE_REG, 0); >>> + >> >> >> If probe doesn't enable this, remove shouldn't disable it. It can lead >> to odd cases if the driver is removed and added again. > > I want to make sure the LED is off and in standby mode. Maybe I will just set it to > the default value instead. > Why? If you want to do this then implement PM controls and put it in standby mode there. >> >> Plus, removing the driver is not a command to disable the LED anyway. > > True but you don't want to leave any LEDs in the on state without a driver to support it. > This could burn out the LED or the board if left on on max brightness > I disagree, we should not try to decide what the user wants here. We should only do what we are instructed to do, which for remove() is to cleanup what probe has done so the driver can be removed w/o leaking memory or device state. > > Dan >
next prev parent reply other threads:[~2018-05-10 14:31 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-10 12:27 [PATCH v4 1/2] dt: bindings: lm3601x: Introduce the lm3601x driver Dan Murphy 2018-05-10 12:27 ` Dan Murphy 2018-05-10 12:27 ` [PATCH v4 2/2] leds: lm3601x: Introduce the lm3601x LED driver Dan Murphy 2018-05-10 12:27 ` Dan Murphy 2018-05-10 13:44 ` Andrew F. Davis 2018-05-10 13:44 ` Andrew F. Davis 2018-05-10 14:04 ` Dan Murphy 2018-05-10 14:04 ` Dan Murphy 2018-05-10 14:31 ` Andrew F. Davis [this message] 2018-05-10 14:31 ` Andrew F. Davis 2018-05-10 15:16 ` Dan Murphy 2018-05-10 15:16 ` Dan Murphy 2018-05-10 18:39 ` Pavel Machek
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=7832225b-115c-2316-025e-29929cd4f208@ti.com \ --to=afd@ti.com \ --cc=devicetree@vger.kernel.org \ --cc=dmurphy@ti.com \ --cc=jacek.anaszewski@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-leds@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=pavel@ucw.cz \ --cc=robh+dt@kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.