Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1384695ybh; Sun, 15 Mar 2020 01:43:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvAp5kFkFXMLefQ2LNaMxKJ41WUiOkE5EhsIH2Pp7nOvmWzr3Ef9Ug1XAm2WUc5V7Kw7CK9 X-Received: by 2002:aca:4b56:: with SMTP id y83mr13669545oia.142.1584261786994; Sun, 15 Mar 2020 01:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584261786; cv=none; d=google.com; s=arc-20160816; b=ogyBdAmKgyrhBlQ0pflAFrYe0sCulgPWHh7dzJb/SDM4uztvHCn5ksmDrP6IbCf25e pUmGWgDHy18kqph3arqL804/KXdlT7FE8gotaOZ8JJ3/10Fx/r2pCn0VHru5parrt/uT yvBCjIlibQumkuTVdfYmtH5E9Jc21UPyJx/Khz4k7aE6VmI0uTY1f0zcAExpf55jqNcu gRHstGzIe1iVVQEIh2Ms8KwW82R3QieLZdw3RIP4ZWe3DwIOB3FCdUspTfzhVASn4Q2z 7l2bCx0a4UksuwfnV+4aHGAmyvfrHdfck/uPnlZSTKCSGy9V7vmAh4650pOZE5iyh1KA mmJA== 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=OauhNZE22QAq98Q2ElJMhDBMoe+lRPP5ahvfVkgSF4w=; b=inCZiTJ7eIDT0y1/97AJ8qHWDCUuJQlub2e2LIevLMKUE8iTbjwm4fuQfE+cDkAhd1 /AKR5KhHY7m7Bgnhi+RbKK9J8unh5lQHuZVfajgOEj3hq9XvF25QOe4hH6Fllmho9erj DXhTtX3HrEQt13319IImS/oHJECAZL/KTD6yn1uhM7Hip35sl361n86ousZ3x7643/J7 LsqRnLC0WzsB3TcppPAdhI/RNEpAo3D4WB50fBv/qLco84ESt4OWfwJ6Id7zwL9l/hqL 3KdgpC/9gmCLXvNX1/XaxTwRkAv0tfb1IjsahDJ4KF4nfQoxRvV81VBIYS9oO9Lni3n+ 9cAg== 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 a19si1376352otk.60.2020.03.15.01.42.52; Sun, 15 Mar 2020 01:43:06 -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 S1728062AbgCOImd (ORCPT + 99 others); Sun, 15 Mar 2020 04:42:33 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:49448 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbgCOImd (ORCPT ); Sun, 15 Mar 2020 04:42:33 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 675BA1C032D; Sun, 15 Mar 2020 09:42:31 +0100 (CET) Date: Sun, 15 Mar 2020 09:42:30 +0100 From: Pavel Machek To: Lubomir Rintel Cc: Jacek Anaszewski , Dan Murphy , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH] leds: ariel: Add driver for status LEDs on Dell Wyse 3020 Message-ID: <20200315084230.GA1996@amd> References: <20200314105652.351708-1-lkundrak@v3.sk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: <20200314105652.351708-1-lkundrak@v3.sk> 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 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > This adds support for controlling the LEDs attached to the Embedded > Controller on a Dell Wyse 3020 "Ariel" board. >=20 > Signed-off-by: Lubomir Rintel Does not look bad. > +static int ariel_led_probe(struct platform_device *pdev) > +{ > + struct device *dev =3D &pdev->dev; > + struct ariel_led *leds; > + struct regmap *ec_ram; > + int ret; > + > + leds =3D devm_kcalloc(dev, 3, sizeof(*leds), GFP_KERNEL); > + if (!leds) > + return -ENOMEM; > + > + ec_ram =3D dev_get_regmap(dev->parent, "ec_ram"); > + if (!ec_ram) > + return -ENODEV; > + > + leds[0].ec_ram =3D ec_ram; > + leds[0].ec_index =3D EC_BLUE_LED; > + leds[0].led_cdev.name =3D "ariel:blue:power", > + leds[0].led_cdev.brightness_get =3D ariel_led_get; > + leds[0].led_cdev.brightness_set =3D ariel_led_set; > + leds[0].led_cdev.blink_set =3D ariel_blink_set; > + leds[0].led_cdev.default_trigger =3D "default-on"; Move common settings to a loop? Definitely delete "ariel:" prefix. > + leds[1].led_cdev.name =3D "ariel:amber:status", > + leds[2].led_cdev.name =3D "ariel:green:status", Do the LEDs have some label, or some kind of common function? Calling it ":status" is not too useful... > + ret =3D devm_led_classdev_register(dev, &leds[2].led_cdev); > + if (ret) > + return ret; > + > + dev_info(dev, "Dell Wyse 3020 LEDs\n"); > + return 0; > +} Just return ret; no need to print anything into the syslog. Thanks! Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl5t6nYACgkQMOfwapXb+vKBcgCgkvL/uHuv1zBBuhBprXU+YYXO d84AoJ4BntW5hVTLpp469AW68EFnIwXW =goUQ -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ--