Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9289807ybi; Wed, 24 Jul 2019 01:28:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGtYwmAu0Zn/7hYpM9RBwoKUMeCciwd9PVNeP2FBHmL0kNRBFR0K3WYz5klQ/vBRa+X4nx X-Received: by 2002:a17:902:2865:: with SMTP id e92mr45279383plb.264.1563956881782; Wed, 24 Jul 2019 01:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563956881; cv=none; d=google.com; s=arc-20160816; b=HtujzDMdAR/l7EFPGn9p9VWE8wvvCcPzU1gFav64Gi+AZ1nHTpjCL5C9a10QPOYO8h U6Q+tBYES1Y+7pj7wzlZy3qNBgPM6rAsoAKMs2kJ4DakBLHRT+ZA033SH/xUtEC/kvwZ G+RKTDQeUMD0rvm+JL4WKWsEhCUIKX0W2HAcCiZ8kchCSsOTaDvWukjguxaq6oTnKvop WO0KLpCfGL9smgbb+9qYgwOVhw3jCEWmrsTiq50scQlS8Qkbbv07z06U05Yjs9KUHp+S DxLmVNn4VVtTnsWyUUzjGEJbeB/pAMC5udLYSkij+NfMIbo1cUCliEgboFgSY13+21Z5 1ArA== 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=CBhO//b1Mv8t3fldT3hg9NFY3tt50vLM1dbfXQdhvjw=; b=BHxIv4g+shsEXON6xGCbesHK+l+MuJC4Vx4PjGC1FU1+30W9pnedq9ZXqUBgQd+MSE UARyzSiV3Kb7+B5cn6p50e3134nf2vQFOAXLBzhkYKnK7Xc7RopV+ekc6msxEO1vwp7b 8BlhJNwMyZGBYzZwrkuY4jbPJKWUqH+9nBYkgUMliA6dxsbSPoRHpss5RwXCWCB+v40J Gt5mpQqqxAxtHNxTefuwfIFc5lvKvjvxPbjeK5nCo8ASX5Zcrnivnjm7iYKc400YILCQ +7kRfDCMGzvKH6tD0R3LyujPRpAiGZtNU1bNq6yWk9V8nTa/6yNFfBK4/vT8TX3aQwwt omvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=D0p3Mc07; 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 p1si13613007plq.286.2019.07.24.01.27.47; Wed, 24 Jul 2019 01:28:01 -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=D0p3Mc07; 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 S1726410AbfGXI05 (ORCPT + 99 others); Wed, 24 Jul 2019 04:26:57 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41070 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfGXI05 (ORCPT ); Wed, 24 Jul 2019 04:26:57 -0400 Received: by mail-io1-f68.google.com with SMTP id j5so83617384ioj.8 for ; Wed, 24 Jul 2019 01:26:57 -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=CBhO//b1Mv8t3fldT3hg9NFY3tt50vLM1dbfXQdhvjw=; b=D0p3Mc071pUEefJy2mzeuN0fKTpYKSow5oJhq50h2fxfnYdBwxnbUByQp3g8PS83e6 At7iFoflnUuJh+x4blgGMFTDiVc0kOXTzjnwcF+UCwUbiShrIpTOhE2XIL+BqznqbY5t +UAaGLNmoaxWHHuN17Y2UBuy+pjgtYRocCvE6Pfbw2iZq2+TEm2nP9ucMiKLMGc2qfTj ApBqGrOuZB7kDqflOss8X2lqwBRr/6pPdg0uYWFVB6uU0l/UtHPv4aQgbs82rjmWgZgl c/Jb3D2O/z3w7jJXdLE43+asiU+OaAbLv/vy1SFRD6SfPJtk52VMMqvVHF7Yusk1djdr hCXg== 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=CBhO//b1Mv8t3fldT3hg9NFY3tt50vLM1dbfXQdhvjw=; b=YR/IjYSLplM//7lkHiddzZghFnZ0YzfpbL2kjX3TEn0dNv+9T6IjqeO5VwiQzRwane qDGdBlAKNDYTENK7xcL3THsRCbjyn2vOw1iewetm58C44TrmbIrW7yHQWDjO0c5pe5TD QK0EWNfXtqQgub9V7sA15bpokHYm+j8jJ9/Br6K4pIk6mo0q8ceyxw1W/eSxPTITNra5 IIizXTe4jDMnj5IQI9uHw6Yggt6q59jtI3h6SFWzF5Pw1ozHnv8JvpFD3pd9eSScqUw7 k07+9BFZRCT5QsE7fwU7cldOzPqipn0488cTlmtPyJGMzNGIAANZgT5eOEDeDk0oYbic ccKg== X-Gm-Message-State: APjAAAUiZdzS4lV9Wk7NqnlFZo+eLDqvYVLge46Iw54BXoEsYBPyuV88 Q5SfPZamY58O9MrrSeW/cR/bBi+LInbL0dfs+hc= X-Received: by 2002:a05:6638:cf:: with SMTP id w15mr5664293jao.136.1563956816689; Wed, 24 Jul 2019 01:26:56 -0700 (PDT) MIME-Version: 1.0 References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-3-brgl@bgdev.pl> <20190722160603.GY9224@smile.fi.intel.com> <20190723153250.GK9224@smile.fi.intel.com> In-Reply-To: <20190723153250.GK9224@smile.fi.intel.com> From: Bartosz Golaszewski Date: Wed, 24 Jul 2019 10:26:45 +0200 Message-ID: Subject: Re: [PATCH v2 2/7] backlight: gpio: simplify the platform data handling 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:32 Andy Shevchenko napisa=C5=82(a): > > On Tue, Jul 23, 2019 at 08:28:00AM +0200, Bartosz Golaszewski wrote: > > pon., 22 lip 2019 o 18:06 Andy Shevchenko > > napisa=C5=82(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 pro= per > > > > 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 =3D &pdev->dev; > > > > - enum gpiod_flags flags; > > > > - int ret; > > > > - > > > > - gbl->def_value =3D device_property_read_bool(dev, "default-on= "); > > > > - flags =3D gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; > > > > - > > > > - gbl->gpiod =3D devm_gpiod_get(dev, NULL, flags); > > > > - if (IS_ERR(gbl->gpiod)) { > > > > - ret =3D PTR_ERR(gbl->gpiod); > > > > - > > > > - if (ret !=3D -EPROBE_DEFER) { > > > > - dev_err(dev, > > > > - "Error: The gpios parameter is missin= g 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 ch= anges. > This really is unnecessary - we can do it in a single patch alright. Bart