Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3038947ybe; Sun, 8 Sep 2019 05:59:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFz6Pto+3nhgW+m1d378yQ//IchYQ4kdNywa4UROBENVMRTb3pXQZ//1ROrjyvz0y3rRsh X-Received: by 2002:a17:906:a990:: with SMTP id jr16mr14962394ejb.272.1567947541157; Sun, 08 Sep 2019 05:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567947541; cv=none; d=google.com; s=arc-20160816; b=UELJ5hDEpQlzGB8bNTWbXI3jya+TQw2oYgVoUFZe2wYULzm8BWOWbwupQk445wqjWV SkhsPqAe/Oap9xp84XLxSWCBOXqt77evzx+rXyK8Vv3dgbZqo91xeNT/oQfYLmNj0/LY 1VVJDdRVfAjt291SBT3TwUzhny+eU6dzCjCxz9XSl/15KKU1cvnwRgORVZkQB/V5deek zvw3nzmVbsnAkf+lQN+CpsmMUyuU3NIYjhl1uxBUZCfeLJaf5JbZ22wDr0frsjEL7u56 hwnEJ/qqNACT+5BzursIm9JYIYwZY4yl9Z/Kgrff8zfbwtFqa69caBa1b7Y1ESlL8B6M 2MqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mE+nwSAONwuvBNqlD7MsLlQYniTugu7n8jh3NdRRzAY=; b=OQ30uFGsMEliDlIbbuBzIBVgkzstT/oDU5CXDIfulySsTALxfmqM5nh6fqYCfXQJIS KTv3V/3fdbN00by51OH6Vs+zyVV2Ny29tUMNuIsG8G7QSQ1fDJvRzieT6iPN3XJeCQF4 m2IQdRII9fIk39NwGmC38Du3VcIQG8/pz8pfulQlljl+XPlecEJzoZ1rirslK/QVau0W +VUUKu89HIr2NK1JgxQvvYTQ5BDe4Y3NSmQjdLKgfhaWEAvalTTdfsc/pk401qZ0yoOI 5mAxpkTGcnWGl+yfYhNXWO0kBzKGo5cuWSgyTVtV1qAJaNj44alH0d/GkzZMKeupukaW NVNg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18si3998859edx.185.2019.09.08.05.58.37; Sun, 08 Sep 2019 05:59:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726602AbfIHIDJ (ORCPT + 99 others); Sun, 8 Sep 2019 04:03:09 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:53214 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfIHIDJ (ORCPT ); Sun, 8 Sep 2019 04:03:09 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id A619C80534; Sun, 8 Sep 2019 10:02:52 +0200 (CEST) Date: Sun, 8 Sep 2019 10:03:05 +0200 From: Pavel Machek To: Jacek Anaszewski Cc: Tony Lindgren , kernel list , sre@kernel.org, nekit1000@gmail.com, mpartap@gmx.net, merlijn@wizzup.org, Dan Murphy , linux-leds@vger.kernel.org Subject: Re: [FYI] lm3532: right registration to work with LED-backlight Message-ID: <20190908080305.GC25459@amd> References: <20190827215205.59677-1-tony@atomide.com> <20190828085339.GB2923@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3siQDZowHQqNOShm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3siQDZowHQqNOShm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2019-08-28 22:32:57, Jacek Anaszewski wrote: > On 8/28/19 10:53 AM, Pavel Machek wrote: > > Hi! > >=20 > > Eventually, these will be needed. > >=20 > > Best regards, > > Pavel > >=20 > > commit 38d956977a7d6cbdc811676f9b4033da7487e045 > > Author: Pavel > > Date: Wed Aug 7 12:43:52 2019 +0200 > >=20 > > d4: lm3532 needs to use right register function for backlight to wo= rk. > >=20 > > diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c > > index 365a22a5..f98e657 100644 > > --- a/drivers/leds/leds-lm3532.c > > +++ b/drivers/leds/leds-lm3532.c > > @@ -629,7 +629,7 @@ static int lm3532_parse_node(struct lm3532_data *pr= iv) > > =20 > > lm3532_init_registers(led); > > =20 > > - ret =3D devm_led_classdev_register(priv->dev, &led->led_dev); > > + ret =3D devm_of_led_classdev_register(priv->dev, to_of_node(child), = &led->led_dev); >=20 > We no longer have devm_of_led_classdev_register(). You must use > devm_led_classdev_register_ext(). Something like this (untested)? Pavel diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c index 62ace66..6340d5b 100644 --- a/drivers/leds/leds-lm3532.c +++ b/drivers/leds/leds-lm3532.c @@ -577,6 +577,11 @@ static int lm3532_parse_node(struct lm3532_data *priv) priv->runtime_ramp_down =3D lm3532_get_ramp_index(ramp_time); =20 device_for_each_child_node(priv->dev, child) { + struct led_init_data idata =3D { + .fwnode =3D child, + .default_label =3D "backlight", + }; + led =3D &priv->leds[i]; =20 ret =3D fwnode_property_read_u32(child, "reg", &control_bank); @@ -648,7 +653,7 @@ static int lm3532_parse_node(struct lm3532_data *priv) led->led_dev.name =3D led->label; led->led_dev.brightness_set_blocking =3D lm3532_brightness_set; =20 - ret =3D devm_led_classdev_register(priv->dev, &led->led_dev); + ret =3D devm_led_classdev_register_ext(priv->dev, &led->led_dev, &idata); if (ret) { dev_err(&priv->client->dev, "led register err: %d\n", ret); --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --3siQDZowHQqNOShm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl10tbgACgkQMOfwapXb+vLbkACfVHJPljIY8z+7ENHAWo1e8ar3 CakAni8uQLaz+4Y9a4FODGqVon8Q8B5n =DZYk -----END PGP SIGNATURE----- --3siQDZowHQqNOShm--