Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9289696ybi; Wed, 24 Jul 2019 01:27:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKp59hNNUh5GQzK1Z5NyPyo13GtYoyllljEIWJVyFgqmbIYZkl7/1K+vI/lAMi3dublQMo X-Received: by 2002:a17:902:ab8f:: with SMTP id f15mr83706082plr.159.1563956873403; Wed, 24 Jul 2019 01:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563956873; cv=none; d=google.com; s=arc-20160816; b=twavD03evwBdgmnAmpXmK3A8etcW0Zs1bzuCpf9xwXIO58VpxFfOqTgS4ifCjx6J+f HyDI3W75vfuOPa5weA/WYYSW14yqI49lvPKjHLJW0AZdeFjQFjNuF1Ejcs8AlwSLPHbo UHFYy2UQtnel2Md89NTN8JNIqkFszdUpJgjXJMd3NjImHx94jtyO5yw0cEYS1ntruilV nTFpH6oaMcvhu+/44y3vodevV+ijrhNxmL7hZ17waEvpogsV2ofU2B2+Io8NFAJriFcw Ug59NRBozyGUZDvu8KfcEEse304hJoFfg0ENrCa+l1vqb83lpy0fpM9GShxOK6DqJIua xBBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0rTt0PWs8SlpFEmIlcfrWeoOuNH1aWKTFUUCUoidq3I=; b=BllE/D2q5i6Hn71LgEe/bPmrZUGpXobeWJV+3ja6DnNXTabITIqOudp9J+9g081wxh YhjmsbarhwMsc0LXDNkRlY3s8ghXb1/DLzQPfSygJ0EzFny0PQ0E7LPmjk2oJP1y9JgC xVcwA19SaP/pwNZeBC1UuUoDE4Y1S7PBhRYdJ1Jj8y9in3x/VBsO54+VXkDZAYtq72jl Ojae2qpHeO0QZPa21MsWzq9H7AToBDHL5cQCCnm/cF7QpxZ55HdJRaNs9sHDrGqzK6Iq COqQGX7WqT7Jv7iOPFC1SOP1Pq4mWY/0LdrMrwYAGar1cedO5AYMTlpbtEHxiJIZZKok WmDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=deaX2weZ; 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 n187si16908295pga.165.2019.07.24.01.27.37; Wed, 24 Jul 2019 01:27:53 -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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=deaX2weZ; 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 S1726661AbfGXI0W (ORCPT + 99 others); Wed, 24 Jul 2019 04:26:22 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41838 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfGXI0V (ORCPT ); Wed, 24 Jul 2019 04:26:21 -0400 Received: by mail-io1-f68.google.com with SMTP id j5so83614380ioj.8 for ; Wed, 24 Jul 2019 01:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0rTt0PWs8SlpFEmIlcfrWeoOuNH1aWKTFUUCUoidq3I=; b=deaX2weZdsR6CofrHgiWHgzvTlM6h0FNL2PCIdFa3ZeR+qEBKz/x2vejPlXRHVbmMl JcIU64QqYqXdMxbvfzRnMtxCpqigpmmONPmag0B3S94ydkRIBrNpe+pn6g1aMLWZubZ6 UTzvInvq4w6iEOuIXPRd561yuPuJSvUrs266ftIc1nWLg3ThVkDpL/f+JQCyW061otPx iMDnLvksu7iT66jS8dBgADOsTBJhFtV7c5959cGfsIwCrCTAUGbyH+sqfbEEaX/g7W9P LzHLbNF3ottZFcV9EwyxFemoIAjtlIYkP3wQJVnx/oskfEntjJZYTsB3vBBLbKrJ4T5I 5YeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0rTt0PWs8SlpFEmIlcfrWeoOuNH1aWKTFUUCUoidq3I=; b=BzzRTResusRlERhU4EPqUHk3P0UDwUrQCJqOPv242+hf7fv+rFQzIPJQBC8osEKEKM yun+mA1h4z0VA/mfSCpfBzUy3Fa6QtZB3igo/W8FdsikuE+YgD4fqUSvOvQwGo95jw05 5dMAl6XO38T5xSkP7ih6TRREjeqJIe4HX2ZhCrWTzAhgDDG7dYY5DwvimLg+J4rgNQVs Qpn25wPuBArmz7/Vpt0BTggNKacv+SHOyXnu3W0Ma/TVyb6rgLs7NKUKfkYhARE98SaD a492vqLqgIkF4sTIcF0+s3o35yPdFRSnfX63rQ7TJoj6WnHSbpZ1criYi+vymij8wzuJ vhqg== X-Gm-Message-State: APjAAAUtpMKbh/Q6iAYK05YzrA0ww4eILzXqQ4PG6PL0g3aezaAOJjKM i6iFQc0/UvIP8HKCfsTMd2vaO0FxolVqHSnSMWY= X-Received: by 2002:a5d:80c3:: with SMTP id h3mr67287206ior.167.1563956780894; Wed, 24 Jul 2019 01:26:20 -0700 (PDT) MIME-Version: 1.0 References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-8-brgl@bgdev.pl> <20190722160908.GZ9224@smile.fi.intel.com> <20190723153426.GL9224@smile.fi.intel.com> In-Reply-To: <20190723153426.GL9224@smile.fi.intel.com> From: Bartosz Golaszewski Date: Wed, 24 Jul 2019 10:26:10 +0200 Message-ID: Subject: Re: [PATCH v2 7/7] backlight: gpio: use a helper variable for &pdev->dev To: Andy Shevchenko Cc: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , linux-sh@vger.kernel.org, Linux Kernel Mailing List , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 23 lip 2019 o 17:34 Andy Shevchenko napisa=C5=82(a): > > On Tue, Jul 23, 2019 at 08:29:52AM +0200, Bartosz Golaszewski wrote: > > pon., 22 lip 2019 o 18:09 Andy Shevchenko > > napisa=C5=82(a): > > > > > > On Mon, Jul 22, 2019 at 05:03:02PM +0200, Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > > > > > Instead of dereferencing pdev each time, use a helper variable for > > > > the associated device pointer. > > > > > > > static int gpio_backlight_probe(struct platform_device *pdev) > > > > { > > > > - struct gpio_backlight_platform_data *pdata =3D > > > > - dev_get_platdata(&pdev->dev); > > > > + struct gpio_backlight_platform_data *pdata; > > > > struct backlight_properties props; > > > > struct backlight_device *bl; > > > > struct gpio_backlight *gbl; > > > > enum gpiod_flags flags; > > > > + struct device *dev; > > > > > > Can't we do > > > > > > struct device dev =3D &pdev->dev; > > > struct gpio_backlight_platform_data *pdata =3D dev_get_platda= ta(dev); > > > > > > ? It fits 80 nicely. > > > > > > > IMO it's more readable like that with the reverse christmas tree layout= . > > It makes more churn in the original code and for initializers the order i= s > defined by its nature. > > -- > With Best Regards, > Andy Shevchenko > > Fair enough, I changed it in v3. Bart