Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7451582ybi; Mon, 22 Jul 2019 13:29:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9xcLCaJjPaa+3AHyx6KRvuohkYQOGYW+pYUYoYlsKcqoUOAK2SqoDL7bRykdU04PUeULm X-Received: by 2002:aa7:9118:: with SMTP id 24mr1912472pfh.56.1563827382422; Mon, 22 Jul 2019 13:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563827382; cv=none; d=google.com; s=arc-20160816; b=hUZFb39kxH2k8mOYbCQHOspUohbNodz/AYMSnTvBMZfqBj+XCjcGibRxP3JaUVnZ8j EJvm6s+oorzeDuiK78qUr2fZaq//Li7d7Ea73bVSi01m8WekEDTsupw6KeKmQA58x3JW kG4hJ2rqZc2aPsZ4dzkNFaX9oyB8S3iZdY2Wz6PYpLyHixSc/Lf6nQLrMGgJNMaylyCC 1tM3pr7578RWosADz1utWzYuVEboprQZQLsDkssJq1+G8ZW7s+yLNN3kShSRIDy+96/U Ndenm7A6i59ObNdzTc0MRaO7Aulqs2eYJ1BXH3RVDpEXV2NqOArjErL/9cVlqwN5hoWO S8dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1MKkvOF7Btm+MOUVShK2O3ttmveJxG8Ek8nTOarTKh8=; b=gikVlXYPfGOI5W04+udaQd7peaU7SijdwOsblJZwzHfXFtA/G5mQRnyA7oezgHp07s Uc60YwxBo+V/Ub1O3tniZ8kAuvTkbllu7WmL7SFzW4BqffAQGYqvOhfUtTH/tEtFl8D5 JifszdryvkGT2gTt7OI+k5kM6H/JOzo5TEanloRV/O1bIwwzYrwXbX1nYsPfu5Y7B4L1 97axgnmyzAzxPpdf4IG5b60NonYNH8ipC91RiJT9lNt3pOnMkNG4+RAsOTz12JZubsz8 joklxNPX38YsBKB2xPfoTZuFCqKJA29YGcQ5QgXat3pE7MguUYt3M45xyPz+MqSjRdon fnBg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 124si12318507pgg.581.2019.07.22.13.29.26; Mon, 22 Jul 2019 13:29:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730150AbfGVQJO (ORCPT + 99 others); Mon, 22 Jul 2019 12:09:14 -0400 Received: from mga17.intel.com ([192.55.52.151]:52450 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbfGVQJO (ORCPT ); Mon, 22 Jul 2019 12:09:14 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2019 09:09:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,295,1559545200"; d="scan'208";a="180441409" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by orsmga002.jf.intel.com with ESMTP; 22 Jul 2019 09:09:10 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hpas8-00075M-KV; Mon, 22 Jul 2019 19:09:08 +0300 Date: Mon, 22 Jul 2019 19:09:08 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v2 7/7] backlight: gpio: use a helper variable for &pdev->dev Message-ID: <20190722160908.GZ9224@smile.fi.intel.com> References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-8-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190722150302.29526-8-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = > - 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 = &pdev->dev; struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev); ? It fits 80 nicely. -- With Best Regards, Andy Shevchenko