Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8474084ybi; Tue, 23 Jul 2019 09:11:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyc8fle1OIhOfw1moBXkEaMhV2Vsc+kYLf9izNBK3jtl6a9QimHZFulaRTBBu5jOYcXnPWY X-Received: by 2002:a17:902:2868:: with SMTP id e95mr76103149plb.319.1563898282672; Tue, 23 Jul 2019 09:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563898282; cv=none; d=google.com; s=arc-20160816; b=xXc2NW3JahrXvUf4FpxQOJ4r3YWSxvWLf959wTFatzoT7YQvfaLFUPUfx57PPCe45w wgHjDa9Mc1W7qnWkmTQ3WrrsmmJBPh/dah7/c6U7OYudCOEWnyRpOAbk6RxjSZV0X+af N9FOzDJBupT7KDsHuY/9BrhcxirlzvUwM4geX7rjQCaWS00g85sMx2Po/nThmwfFmUIP c2etXiu9Mj34N4wNXSx+khDpbmeaILDgFo/pPFLOJcplkCb+x7OwchPtG+oy8Qwnoyzb AzEEVuu75lULXF3JrZtcXigQP3JYS2ROH6O1hw5e7ERz7qHWRmgmVXs30zcIqZkgycd8 Jkmw== 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=j31K/zZs/r0C+pUWsqptIpZI42gK74CrCWxKrCU84XI=; b=u4cjnprDcAsyGn7l6MMylVN7mXes+BWw4rg8IGDlNbiuERaJw2hnp6tt7kMeN00yto G50tm6BbvpL4a/bMjHiBETpUqA/ExCEDetHjkdzaypWIRKsQ7Czt5el5LYRcsupQkUul GTi8CUx9tOO9v9642m8E8/h/UsTIfPAWoPPFIuQvSSHoG9xn1OtPiNPbU1nqQyv+yCQV LHGIdSyy+eeklmnkPSKj0AzWTi8IvhVvH2/vOVnamxv7qxR49W+H/tL2I0CTsKXL+2LY /juWc9A3iOkVz/m3PXvQlaojwqsMW9ltkzfEZe7Z9vjgsItdnj1+M+8ipCc5AieUWrFG tX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=N8Pla93T; 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 36si12755831pla.80.2019.07.23.09.11.06; Tue, 23 Jul 2019 09:11:22 -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=N8Pla93T; 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 S1732220AbfGWGaE (ORCPT + 99 others); Tue, 23 Jul 2019 02:30:04 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:44781 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730545AbfGWGaD (ORCPT ); Tue, 23 Jul 2019 02:30:03 -0400 Received: by mail-io1-f65.google.com with SMTP id s7so79350920iob.11 for ; Mon, 22 Jul 2019 23:30:03 -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=j31K/zZs/r0C+pUWsqptIpZI42gK74CrCWxKrCU84XI=; b=N8Pla93TcEziqi3X9Xjj4jVFB6FXqFhyq+3mUxlpciUlrARDlvGyjeKc8SeQnuargV FN6ErDmNUCoDrH38zU3JHuoPpuMAZNLdPp31tlj7ewshoZqqtBcK4IcRQdbsI1CnMMnf 5hA4bFDG/lArM1NQncuEu6rCSt6B3ndlw72yX0NSAbnaljYkk7CEAllPFu0SIId5I1sR U4Gz0rRgvvvgcQ0Z2hH1/E5sC3rwRaUiZNNJSe6iPAruMUZ1eoSTZcqyBloG9heNAprb mq31Yh74BQ+6PWAPc/rKE5g3B2XGRnySLEyQi2Wwan8kv19qIdLhvRoPKkKlTaKDka6Z z+Ew== 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=j31K/zZs/r0C+pUWsqptIpZI42gK74CrCWxKrCU84XI=; b=mC+L9rdehJDnnkCCSdIzDxmLGwusAEedKi1VjtXnzS4nqTNx1R83hcazmOwMBi6IhH QtwvhQ9cANAbqp6NJ17GdDiIqEIIQGNPgCQN2diiFcq3PT4c1N+uMOh4lgSHIiZ1fW9j CaKYYybJk+lAlD3Y+ZlxXn6XnbNKzjZj8xfLbSTi8P6k1iYQCQ3mTRR/FmIfvDiM6qmm hnW5XIaUV4lIYYXxg7KvXiy2Im8yb+U7uON0cuTc+AIAZTJLJxlJQCK6zcZyFTqfdGek mfBHWStbEsG5taq0orMlD6Fc6yLvvuZ4E02LDwyP9YDX1Etk52dm+XCNwKIYl2r3HNCK rUCA== X-Gm-Message-State: APjAAAUK4SvBqF449bIwLfQzpirFby4F8jL50FnynoolpacU8l/l9MVS p+aq4RIOl7vafYCYrqYfHzLXx28SuFMbSQT8Zpc= X-Received: by 2002:a02:c916:: with SMTP id t22mr21391578jao.24.1563863403112; Mon, 22 Jul 2019 23:30:03 -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> In-Reply-To: <20190722160908.GZ9224@smile.fi.intel.com> From: Bartosz Golaszewski Date: Tue, 23 Jul 2019 08:29:52 +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 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_platdata(d= ev); > > ? It fits 80 nicely. > IMO it's more readable like that with the reverse christmas tree layout. Bart