Received: by 10.192.165.148 with SMTP id m20csp335453imm; Tue, 24 Apr 2018 23:43:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48lpEKFwkmK62geki1GIuPckJUJ8E07MNOYQWgP1fa3usUUgz62C8b3iJcT+EAcSmPXq6ka X-Received: by 2002:a17:902:7684:: with SMTP id m4-v6mr23448589pll.340.1524638580517; Tue, 24 Apr 2018 23:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524638580; cv=none; d=google.com; s=arc-20160816; b=N9+iNa9ZCy5FPOk9NcUfpokJuEABXlvXWS7sOC/lhOkxJfXDNJL04Y1cFK0+uEhwAP rO6jE8iboAexpRs9dJ4yr7w4UbIJAJ2g9QIfRj3L7EHI4yc7kbWHZhcifrXWEfkGNJlm KX6zDhQcXsPywdRjB4x6EwniVeuP2vHPlyu8icF7gq1wfX7Txj7Ypdyrvwb0m4jcX1fT 17XOxERmP+7ITG8smP4/31Wvgg/B6WG2oeiRXpKOOtdesQ+DT52Rf14ePc/TUi3pyXBw hwz9zrusRrZGUguU+2SoELP111fs5i6jZqOAUH/j1Ykdbw+ix/GVLQfqF1OV5RprPutU Kr8w== 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:arc-authentication-results; bh=w/HfkQjHqz2Hj013TH6e/K3Up11phoOhjWMC5aeZUlc=; b=Gx/j9U3s+BHxvcSpIOptXxux3GQFY1j9zRj4tiToqSuBTckpB818ffi/h144eR5Yhg uLP9GQw89pYfbn8uMJ7xnFnsy5g/D18iY7DnwAKxDRnQovoHTHWjj5fnDXL/kvS+LIL3 /JpisEVyjWZ7/4NRWxcrVhiXA+nT3dUrWzdwb1Dc+9VvAB9nZFY5j1BUKvEUGRGw+Twd SbjTcul58xdjnc+yKXLlKXR3SzqPSz/Za2x+qaxYfXZ5yr5NzktX+/0Jv49rTBbG+SsE zXgM4VMXpbw6jvFEAwigGGbtAFQd416dmQ3XpI5CrkJJeKLh2wWlxI8L+EKbmMcQ0vm6 +Vhg== 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 w9si12742993pgp.10.2018.04.24.23.42.46; Tue, 24 Apr 2018 23:43:00 -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 S1751410AbeDYGlh (ORCPT + 99 others); Wed, 25 Apr 2018 02:41:37 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:43541 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbeDYGlg (ORCPT ); Wed, 25 Apr 2018 02:41:36 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id B74B980488; Wed, 25 Apr 2018 08:41:34 +0200 (CEST) Date: Wed, 25 Apr 2018 08:41:33 +0200 From: Pavel Machek To: Javier Arteaga Cc: Jacek Anaszewski , Dan O'Donovan , Andy Shevchenko , Mika Westerberg , Heikki Krogerus , Lee Jones , Linus Walleij , linux-gpio@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH RESEND 2/3] leds: upboard: Add LED support Message-ID: <20180425064133.GC5352@amd> References: <20180421085009.28773-1-javier@emutex.com> <20180421085009.28773-3-javier@emutex.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yVhtmJPUSI46BTXb" Content-Disposition: inline In-Reply-To: <20180421085009.28773-3-javier@emutex.com> 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 --yVhtmJPUSI46BTXb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat 2018-04-21 09:50:08, Javier Arteaga wrote: > Allow userspace to use the on-board LEDs as "upboard::". >=20 > Signed-off-by: Javier Arteaga > +static enum led_brightness upboard_led_brightness_get(struct led_classde= v *cdev) > +{ > + struct upboard_led *led =3D container_of(cdev, struct upboard_led, cdev= ); > + int brightness =3D 0; > + > + regmap_field_read(led->field, &brightness); > + > + return brightness; > +}; I'm slightly confused here. Is each led controlled by single bit? > +static void upboard_led_brightness_set(struct led_classdev *cdev, > + enum led_brightness brightness) > +{ > + struct upboard_led *led =3D container_of(cdev, struct upboard_led, cdev= ); > + > + regmap_field_write(led->field, brightness !=3D LED_OFF); > +}; What is going on with ";" at end of function? We don't do that. If it is single bit, max_brightness should be one, and !=3D LED_OFF test should not be needed. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --yVhtmJPUSI46BTXb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlrgIx0ACgkQMOfwapXb+vLP/wCeObvNSVSgW6bpxoY4s1PqXv3B N8YAn3vU/1h/+9wsoQPYbjsRBWnpWLnG =8EzT -----END PGP SIGNATURE----- --yVhtmJPUSI46BTXb--