Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1907981ybb; Sat, 21 Mar 2020 08:22:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vueRpaew+Dp2ILC4TBzZNcZBWR0WwYQ3mF+0PrE0NAPuHJzRU6eycvOOLWlHNN33oF6Kn7o X-Received: by 2002:a9d:525:: with SMTP id 34mr10915396otw.80.1584804144602; Sat, 21 Mar 2020 08:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584804144; cv=none; d=google.com; s=arc-20160816; b=IaOUgh7HSLF2ZS4Y754gH2f/tSztxsYJMyGwsfoerS0ja/o/gS6jn4urCWPxkWAR4s DugJ3OSyZv2qROVJAabrXznmlDd7I2jEZW4qa6YqnFMYlzpeWghE207RZOLDO/4OWFJd nIlKpNM8yxLG5la2y0xd1zHfg/4M82dg6tUiaiDLNoXNmpQ25JMeDQlfYslqQundxRK2 JinxhcpSVMtl96ZEA59YS0NCQahENkGmQ+7dooGkNj9nRz37seQCZ91EgSXH9+sBOTrc /DpXHxkv6/vUDqsMQ21OmJk3dIp3E/sfOKSbdOHWXvXETMrPBQMIr7pvaOC7IUJZpN2A SVow== 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=Dj8/MHwVVZyNESzWcc8k5whFxgVzuHPuUKjwm/EOClI=; b=PouhW79BKwulpgVwWQe+AoZ5r4BtJWCPyJ9EnKg1LnmdajbmhIb372rxZbYWKsdsRA Jr5fdW8uQ9h7qcCAcdWjPAtWctKsjXKMMcrt06O6BddZRLtkEE1NRDaubGQRwFv19Jqz TW3kk0197Brbz8Id0xmqQgDSuI3NXdVoYUOCpw1ryEj90ETh4xt2N/qANb36ILtXKTJ8 erNT6PxwMrtKPhbjW+nKqwvz5nK84XRR0luqOHjAA/0jpPD9gAoAP0bGSy/Q5KTnoZ4N 3gtNlWWuI3a8K3hyWzDvs0qVHzKta0M7Siqg2X4h6sYP/BqCQNDIb9f04JaX77AmEhm8 HrLA== 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 z24si4912329otp.159.2020.03.21.08.22.12; Sat, 21 Mar 2020 08:22:24 -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 S1727452AbgCUPUp (ORCPT + 99 others); Sat, 21 Mar 2020 11:20:45 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:52352 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727028AbgCUPUp (ORCPT ); Sat, 21 Mar 2020 11:20:45 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id CF6FD1C032C; Sat, 21 Mar 2020 16:20:42 +0100 (CET) Date: Sat, 21 Mar 2020 16:20:37 +0100 From: Pavel Machek To: Denis Osterland-Heim Cc: "dmurphy@ti.com" , "mark.rutland@arm.com" , "jacek.anaszewski@gmail.com" , "robh+dt@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-leds@vger.kernel.org" , "devicetree@vger.kernel.org" , "uwe@kleine-koenig.org" Subject: Re: [PATCH v4 3/5] leds: pwm: check result of led_pwm_set() in led_pwm_add() Message-ID: <20200321152037.GB8386@duo.ucw.cz> References: <20200321081321.15614-1-Denis.Osterland@diehl.com> <20200321081321.15614-4-Denis.Osterland@diehl.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" Content-Disposition: inline In-Reply-To: <20200321081321.15614-4-Denis.Osterland@diehl.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8GpibOaaTibBMecb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > led_pwm_set() now returns an error when setting the PWM fails. >=20 > Cc: Uwe Kleine-K=F6nig > Signed-off-by: Denis Osterland-Heim I applied 1 and 2, but 3 failed for me. I'll push updated -next, can you see what is going on there? Best regards, Pavel > +++ b/drivers/leds/leds-pwm.c > @@ -91,15 +91,21 @@ static int led_pwm_add(struct device *dev, struct led= _pwm_priv *priv, > pwm_init_state(led_data->pwm, &led_data->pwmstate); > =20 > ret =3D devm_led_classdev_register(dev, &led_data->cdev); > - if (ret =3D=3D 0) { > - priv->num_leds++; > - led_pwm_set(&led_data->cdev, led_data->cdev.brightness); > - } else { > + if (ret) { > dev_err(dev, "failed to register PWM led for %s: %d\n", > led->name, ret); > + return ret; > } > =20 > - return ret; > + ret =3D led_pwm_set(&led_data->cdev, led_data->cdev.brightness); > + if (ret) { > + dev_err(dev, "failed to set led PWM value for %s: %d", > + led->name, ret); > + return ret; > + } > + > + priv->num_leds++; > + return 0; > } > =20 > static int led_pwm_create_fwnode(struct device *dev, struct > led_pwm_priv *priv) >=20 > The contents of the above mentioned e-mail is not legally > binding. This e-mail contains confidential and/or legally protected > information. Please inform us if you have received this e-mail by This is lie. Please don't do this. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --8GpibOaaTibBMecb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXnYwxQAKCRAw5/Bqldv6 8kXiAJ4npfPQ8vzqkySsj2s8Qpj/BC45GwCgwKItekyjd/+ilSTTBVyp1/byw3A= =rXOy -----END PGP SIGNATURE----- --8GpibOaaTibBMecb--