Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8901002ybi; Tue, 23 Jul 2019 17:41:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJmwB4NHiGBbT7dfSN8d3Lve0d33XejYS7xDKHHm5b9rf7K737cQhAHcEDDMJYpNthwf1C X-Received: by 2002:a63:f13:: with SMTP id e19mr78533471pgl.132.1563928914725; Tue, 23 Jul 2019 17:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563928914; cv=none; d=google.com; s=arc-20160816; b=uRTQ8/WK/O/Ha/wqCAPcwB9pf+tMYutu6wN2txjWhqgA3maYbt19ATcyz0reX8AXrG qHeX105KjezY0itse0qAlXl2olyKpmC5amk8WU4fDo/2Zgm2BRBxcPUsunOdHTZWNXrt sOR01QGl5uwnEONMbpo3lsLr9fcV4UCsAYKHfvTpsP8/WDuBZxRuVMV6AD7S+IPdjslj FQGxAx6gavW5IuetGhPJOx2XjmH3mPv2t2KHFnq4gIY6WcnIo2VCrjRqvHOYOn156VoR O2vjsHoMJsH58+BpFCxawstxdS4RkU1yQonbsT/84KJ/WGYc8JlkqRrtnYBj9EBg+Ytr qMWQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DZ13b8lVdQtADng4sAI8gt23j9550GXo3j4U1vsNAXc=; b=oCTCxxmUKopQIjwOD4pUy5JBsV0/NCP8hn0h7a4vzKDGZvs3JLszheHoboJbmT2zCn NvAcBS69Jb6GM7dMpXudYA34nW0Sr11PQhKyKl8A6XaFzkv2zlkWwaF8SsXwnz80PqZQ LMfy9axFmaV6oKMxf3nJ/5tuUrkKeA6ojbCrXqRDRSa9REsbyKR0jIvRuYNgrjnFONqX h3C1Py79GUHYTJweo7qS2m6CXxJJNOdFqpy43WfAAjpC04VW0XDiSn9elcnEybKrFFZN PDmscGlCd6uBHGG7qxcMWVUs/Q+Gf+Mv/Pkp+MrceD61DhrdQ3HpQtXUKMsKsaw9a+Sr nVhQ== 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 v14si12525339pgb.375.2019.07.23.17.41.38; Tue, 23 Jul 2019 17:41:54 -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 S1732079AbfGWPc7 (ORCPT + 99 others); Tue, 23 Jul 2019 11:32:59 -0400 Received: from mga14.intel.com ([192.55.52.115]:2636 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731869AbfGWPc4 (ORCPT ); Tue, 23 Jul 2019 11:32:56 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2019 08:32:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,299,1559545200"; d="scan'208";a="180772567" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by orsmga002.jf.intel.com with ESMTP; 23 Jul 2019 08:32:52 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hpwmY-0004Hw-9w; Tue, 23 Jul 2019 18:32:50 +0300 Date: Tue, 23 Jul 2019 18:32:50 +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 Mailing List , 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: <20190723153250.GK9224@smile.fi.intel.com> References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-3-brgl@bgdev.pl> <20190722160603.GY9224@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Tue, Jul 23, 2019 at 08:28:00AM +0200, Bartosz Golaszewski wrote: > pon., 22 lip 2019 o 18:06 Andy Shevchenko > napisaƂ(a): > > > > 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)? > > Why would we do that if the entire probe() function is now less than > 50 lines long? Also: it gets inlined by the compiler anyway. It > doesn't make sense IMO. I'm not against this, perhaps, dropping and moving can be split to two changes. -- With Best Regards, Andy Shevchenko