Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7451188ybi; Mon, 22 Jul 2019 13:29:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhfuYGeaH6aMjvqvVptVnI18lTVmIFEekfdi/DSx4UGnlgjiaXCwdQe76/sKZ8sXTGbGvz X-Received: by 2002:a17:902:b206:: with SMTP id t6mr78185075plr.195.1563827348881; Mon, 22 Jul 2019 13:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563827348; cv=none; d=google.com; s=arc-20160816; b=op+/I5knWDNv6FjueMepHIAd4pJ7nsZIFKA1bPTF3aGRIaeF5PSsPU+2uVgCV5QjJv xyV7Z1MaCp16TMRXU7emWNKpi4sbcEb1d4ivTviY+shRbV/ZxcOASwYSrDX8WVybj4s/ nk9AJgxMf8+9v+HnPV7cGzJb1hm5cRqXi4nl3eUjSmoMtX0roNX7ZG9Crsvuygd2Adua FuTwJc6FELK24NOHJgfN523hNK1cfgQw0Jn63xYX+6RU63OwjKDH/9uphB/GK4s6AQEy aE3exZt/0PaVZnCjduK2MwrPkfsyBWPy40NBWbjonQ9q5wAtlxzcVH1NMBTg5pzWCMWc mxHA== 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=rh0S3SM1MJ22gHo5/3bRru0Ikg0dGOSojAZcn11Qttw=; b=h74LKip+dSP5MoXW21iWqtjXw/AUJ1NtI9HLRpTc5aKDMjkRPdeXQnKsJAtSY5oaM5 Hzq/JRPPBFa34/sbYtMJ5aaKFmbOXKSua69JJ7V2n7AUmNtJfYXQ0be4CNK5xH/YLvY6 zacow3ZYwPjth6bfsd6fIaxp+JUNjcp0Eb7lmCMXXgb2LjBBtKUwtKvUyV10ALeqjIH9 EwbQkKo4nXgu0Pvmy+jR5tknilBfS6GlNNcUyAOUY6OWpM0QOKRPWnJbjijmfmgm9sEx BJg+uqXNL7ieDaORpp7uS7fHSH1Q6nAxE6qm+6+iSijUsI+oRQdlO37y6kc04ZmKHda4 18EQ== 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 d22si9016881plr.120.2019.07.22.13.28.53; Mon, 22 Jul 2019 13:29:08 -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 S1730396AbfGVQGJ (ORCPT + 99 others); Mon, 22 Jul 2019 12:06:09 -0400 Received: from mga05.intel.com ([192.55.52.43]:20645 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730127AbfGVQGJ (ORCPT ); Mon, 22 Jul 2019 12:06:09 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2019 09:06:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,295,1559545200"; d="scan'208";a="174264795" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by orsmga006.jf.intel.com with ESMTP; 22 Jul 2019 09:06:03 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hpap9-00072x-7M; Mon, 22 Jul 2019 19:06:03 +0300 Date: Mon, 22 Jul 2019 19:06:03 +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 2/7] backlight: gpio: simplify the platform data handling Message-ID: <20190722160603.GY9224@smile.fi.intel.com> References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-3-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190722150302.29526-3-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:02:57PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Now that the last user of platform data (sh ecovec24) defines a proper > GPIO lookup and sets the 'default-on' device property, we can drop the > platform_data-specific GPIO handling and unify a big chunk of code. > > The only field used from the platform data is now the fbdev pointer. > -static int gpio_backlight_probe_dt(struct platform_device *pdev, > - struct gpio_backlight *gbl) > -{ > - struct device *dev = &pdev->dev; > - enum gpiod_flags flags; > - int ret; > - > - gbl->def_value = device_property_read_bool(dev, "default-on"); > - flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; > - > - gbl->gpiod = devm_gpiod_get(dev, NULL, flags); > - if (IS_ERR(gbl->gpiod)) { > - ret = PTR_ERR(gbl->gpiod); > - > - if (ret != -EPROBE_DEFER) { > - dev_err(dev, > - "Error: The gpios parameter is missing or invalid.\n"); > - } > - return ret; > - } > - > - return 0; > -} Why not leave this function (perhaps with different name)? -- With Best Regards, Andy Shevchenko