Received: by 10.223.176.46 with SMTP id f43csp2212544wra; Thu, 25 Jan 2018 06:38:19 -0800 (PST) X-Google-Smtp-Source: AH8x224fy92wLF6OxSUnRl8rF4NCS2TA4mc5E2GLnvReSUdkCbV8yIsjMOsycJy/UOvivulN5nfB X-Received: by 2002:a17:902:5509:: with SMTP id f9-v6mr2093713pli.83.1516891099416; Thu, 25 Jan 2018 06:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516891099; cv=none; d=google.com; s=arc-20160816; b=w68FzUMb4m3PM/FQWOSc+NGX1dz0hpzs4rB8ZwNvPHvU8PhGxdvbOkNWz3/MHLDCoP 3ctZQ61PEvNA6FG8S6tyDeRRGKt+MjSwQBEHBWkp+3T85Ye3ejuYLnoPbCqirSgUFOaP xdM/ALiH1fD1rjA4NYhGRVWTkzaGxolBu+INizQGFEQprUtKe63XZxbCJXWciTc9LRZO ZGBl1wPs1rxKW1Hx7eNrt2GM8YBzbHzCsw3OJ/Hk1E6hSmIHlG6h+az+cyqI+95dUKpV /ZqkAS/Nv9iaA4NYjGdOOoewhmc06hN9GNvfUlmY5IfMsAbTYpTqYLgrDYqWde3xrd4u qE6g== 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:dkim-signature:arc-authentication-results; bh=p86NG0OpJsZ6j9bZxxn7hsDeNsQdCe6tVpLdaKuO2pY=; b=mpDQ1D7yeHDdd3S2mHU2mYsHIcFug7pyhI5+UWPj3QTEqAd5LJsudTBz1jszG+IMig bVO4c1jlwDnHpNpweHzIqMyONrvcH0Y+91ZXhmUQVY4GkAM63Ngyb6+5aRosLfCcmnso OTxHHt9PFJPS/FADPJf4Evh+0sfmE0Cavytc9qnW/SQq79mFt0UfKfoqBiwGwGx4X/83 dIHnHdixpsaE9LJD2LzaAXYk1RTYtLSSdP0Z8Ao8OH0AXCtas+3jfV3lGJmrgLjNeAqD qjM2RTxWiSjGzDgm5LwXnElJo/k8nd7AWoRvydjCrkvj6jdY5cTn+sx34vv7zVE/+c/e RfCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HRP5MSZ/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11-v6si2021528plt.649.2018.01.25.06.38.05; Thu, 25 Jan 2018 06:38:19 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HRP5MSZ/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbeAYOO6 (ORCPT + 99 others); Thu, 25 Jan 2018 09:14:58 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:38877 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188AbeAYOO4 (ORCPT ); Thu, 25 Jan 2018 09:14:56 -0500 Received: by mail-qt0-f193.google.com with SMTP id z10so19482180qti.5 for ; Thu, 25 Jan 2018 06:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p86NG0OpJsZ6j9bZxxn7hsDeNsQdCe6tVpLdaKuO2pY=; b=HRP5MSZ/LEy9I/mfSuE9AuscL960xRmAn81YMGMNNgr2BuGG78yjwwdzVOFRpu2xzP 5hNTus84JgxmHU6NNmPwqtemXRLNxfzQPktJYrm2WQVlf/V0jmcAjoknhBb23Wuz5LTl 5QXWpDAxsXqclCksfXH2OEoo69DOtpZQzd3qMlMmkQbuEQYrBys1eUtgMx4W7GZIowTb vEtzGF7a5nuyPNvloC1UpaSUixK+5y3cWQXRj69ETFSaTUM992JC3UjLWk/AtRS9rfTH KFYw/twtsIWrPm3XKZB3EJtAI5DMxqk0MDig4Uuyt8mBApSQM6wnt8kdFvuqYmfjXTA/ NCqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=p86NG0OpJsZ6j9bZxxn7hsDeNsQdCe6tVpLdaKuO2pY=; b=FxaQNrUwzL6YV6sp5Odtq/TbWhLI7QdeeLJDCeSsebzsj7Gf+ErN7qDA6tVyAOngej J0B3iab5MCLWlth+pQl2PZWqcYeldmHXzKKAS9kLKJpOvHtnMIso4nI0oazFP3DjWSen HdjFz82vfRXgPcJ8rDTSYfG4jiFH3m0of6TwiYBjIBPtJRG7pQwm1dqOMf+MLIG0Uyjx nX/Bm4VtjabYDC3LBMR/e2+jwr13tl53EAo6RY/qerpexDGtJIsr3YJq6wKT+lb0zbju mzy6rpl1DW4JeBEk0bTONXYZUoNrT/EzVyUchifUUAFkOLi9jQfEn2VCSDAWBF6xRDy/ dyCw== X-Gm-Message-State: AKwxytfAl7CU6cLNmSFKZ+3t15Os4/U4dWwDkyqPNuWwUPEdsSF4lLde w2ZEBbN2QE9/r5suQTkSDG4= X-Received: by 10.233.221.197 with SMTP id r188mr14770751qkf.107.1516889695924; Thu, 25 Jan 2018 06:14:55 -0800 (PST) Received: from localhost (p200300E41F05C100DA2191AAB13561AC.dip0.t-ipconnect.de. [2003:e4:1f05:c100:da21:91aa:b135:61ac]) by smtp.gmail.com with ESMTPSA id y27sm2456019qtc.16.2018.01.25.06.14.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2018 06:14:53 -0800 (PST) Date: Thu, 25 Jan 2018 15:14:51 +0100 From: Thierry Reding To: Meghana Madhyastha Cc: Lee Jones , Daniel Thompson , Jingoo Han , Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v19 03/10] video: backlight: Add of_find_backlight helper in backlight.c Message-ID: <20180125141451.GD27888@ulmo> References: <116d160ba78be2e6dcbdcb6855622bce67da9472.1516810725.git.meghana.madhyastha@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q9KOos5vDmpwPx9o" Content-Disposition: inline In-Reply-To: <116d160ba78be2e6dcbdcb6855622bce67da9472.1516810725.git.meghana.madhyastha@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --q9KOos5vDmpwPx9o Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 24, 2018 at 04:35:30PM +0000, Meghana Madhyastha wrote: > Add of_find_backlight, a helper function which is a generic version > of tinydrm_of_find_backlight that can be used by other drivers to avoid > repetition of code and simplify things. >=20 > Acked-by: Daniel Thompson > Reviewed-by: Noralf Tr=C3=B8nnes > Reviewed-by: Sean Paul > Signed-off-by: Meghana Madhyastha > --- > drivers/video/backlight/backlight.c | 43 +++++++++++++++++++++++++++++++= ++++++ > include/linux/backlight.h | 19 ++++++++++++++++ > 2 files changed, 62 insertions(+) >=20 > diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backligh= t/backlight.c > index 8049e7656..553bf5c48 100644 > --- a/drivers/video/backlight/backlight.c > +++ b/drivers/video/backlight/backlight.c > @@ -580,6 +580,49 @@ struct backlight_device *of_find_backlight_by_node(s= truct device_node *node) > EXPORT_SYMBOL(of_find_backlight_by_node); > #endif > =20 > +/** > + * of_find_backlight - Get backlight device > + * @dev: Device > + * > + * This function looks for a property named 'backlight' on the DT node > + * connected to @dev and looks up the backlight device. > + * > + * Call backlight_put() to drop the reference on the backlight device. > + * > + * Returns: > + * A pointer to the backlight device if found. > + * Error pointer -EPROBE_DEFER if the DT property is set, but no backlig= ht > + * device is found. > + * NULL if there's no backlight property. > + */ > +struct backlight_device *of_find_backlight(struct device *dev) Just a nit: there isn't really anything OF specific about this. It would be if this took a struct device_node * as parameter. So technically you could implement this for ACPI or whatever other firmware interface as well. So I think a more idiomatic name for this would be: struct backlight_device *backlight_get(struct device *dev); which would match the: void backlight_put(struct backlight_device *bd); and be consistent with how other resources are obtained. Not a big deal, though. It can always be changed later on. Reviewed-by: Thierry Reding --q9KOos5vDmpwPx9o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlpp5lsACgkQ3SOs138+ s6Gmeg/+I2qe8/dpeKRIt+7QEqkQUwtgCeFDcW1yRK0viQhnxzluLLjj4HQY6BWn 4V4QupGOItwPJGUfToMO3lO90MHQ8d9QZZgQlvPWsyfeQZiXltm5y7GELCi4yW/I ZxqHmjkY3uvIbap7gLf2Jq3uq9obm08SQ28o0bw9xD+jZ2HhnGgiBgh73pbNRWnS KN+L7SlYQiAgxO6uQgV3MgdoF3SLELujFdRs5QbT51bnauQYPN5kGB9NiPemTWz2 3CgXtVsEqhtrxRCb0sfBD6PxMqmBdcal7ja3kXCoKRW0c67kAfD8VkRn9nv3420G ChPbEnBKExaw5Ks4ugh2t268sNhAPW0jX4UY+RF9ipZ2GF5om87bl8p0HmPt2o1P 10r9+BCwEOBagUjOyE6QKdUPpJzw+nT3dBQ1uSvoUID559LDk/+TPqUOowBOzfxi p5KELpaxU1WYJW2CZhySC2rWH35VN/hLgw+tPjQv13woj8/uh8z5TmpqDGi6/GEm 8PA3wpqnssz/3u2x8Y7yv9uhjtFh/U8ScFE8afgR1xV2OUCMHUpSdXKK7EreJJLt Oxzg2woqJd3kU8KzIHCA5twJysxujyAoN+GfNxXLB2emUz+0/mDCZVpHCC7tEp9h Qr8WyO3DPEDZ/qwOyY7KpKaKrPTVOjD2sILFZhKZzhLusxDnItE= =0z1I -----END PGP SIGNATURE----- --q9KOos5vDmpwPx9o--