Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8373993ybi; Tue, 23 Jul 2019 07:29:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5GOkVFZ7C6N1If6RaTQt21ejnp28bghnPjYOmRXpUslodNEZq3fE9pI2ZCkk3ZUa1KB3a X-Received: by 2002:a62:584:: with SMTP id 126mr6136882pff.73.1563892154988; Tue, 23 Jul 2019 07:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563892154; cv=none; d=google.com; s=arc-20160816; b=gkhJ6EfDpWOFdvbpmQ7FCAc9zZuqf7VO8fWqsgKeSf1ixLtNpR6dEjx3OHk9+F+nY/ 6ZXRd8K85+qPK3KZtRnXWtAYiXGa6HbX4DJux1K8OhPubAoMvCHn++1c6c1/w8Kv53ZL N2YbW3VdMFXMTmMTsvzi72petV5w7s00oc0eMMC4pPsr6aBRRICKCTpxjGyCoP8NhJzb 1kuSHtzLZI13sA6b+3SoTNzi92ccfIoeO6ytrsyqtl90eb/lCTQE4pLdKYu+PnZse+3e sdK9FBzTzg7Hw6qEsRHc0sEHma28yaHucI+oThc7X/dwvpNSWSATEqsVevGWMnW9Xlil ys3Q== 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=0GXgbin1wM5tD9QHab0bjxqBxoyIQnKJbxMwrdj3eAo=; b=KgcIGVZQmAB7V5w+ctiAbdwLpZsrCKPj6emDnyXD/xhrZQmPflxxFgKDhWhtH1UJ1f 1TzFQ/L/MP/x/Ze/A/74LSqtCBC74VSrB2sVJkkLbQ546qrNK/AygBXOH8TivhLDJsYn ztUqevAq4yhykgA+izL3mE24/yrSQKm/04jiFs91douLkrNog6kiQPQ8WDcAscl2JMwV uo8Ps/s6aVUUphLcNihZI6qb7mzs3/qqSJP94U3qpbM03gVUNCylQq53gfCfDyPDDx30 09yATnL4ZD7KND8ALxxnshkS6nlYFL01hXcB/UdFJJF1dNwJALn3wjIoKr8/7G4POF5O tfAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=AkGT7f1y; 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 w2si11879254pfi.183.2019.07.23.07.28.58; Tue, 23 Jul 2019 07:29:14 -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=AkGT7f1y; 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 S1730412AbfGWG2M (ORCPT + 99 others); Tue, 23 Jul 2019 02:28:12 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:38399 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbfGWG2M (ORCPT ); Tue, 23 Jul 2019 02:28:12 -0400 Received: by mail-io1-f68.google.com with SMTP id j6so4306989ioa.5 for ; Mon, 22 Jul 2019 23:28:12 -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=0GXgbin1wM5tD9QHab0bjxqBxoyIQnKJbxMwrdj3eAo=; b=AkGT7f1yp79PR71yxcX0rmm7mn9Z79r5K4cPrbEDACL9FDwSVMGs0ASUkteU8pEZyU V2uPiHHOlPEy05sWQhcen9i60a5WApuQkPTvMdbhNfXCScSJlWK5Ftvpo+KwtQ+IvVMx EH6BFUQyBsKwbnYnkRjGakuqODnMf9YNpP9paDvwbtk5bL8j0ruMNJygjLDmdLea83BR +vt0S97OasXyEI0jhBs81RbiaJWlYLS70TSoZyzpaN5TF0VnDN5dCgHJtsnshqKIYXcn YUeR6wczHn3AYJNWm3IeS7Uv/hmywYMSI4GjP5nHCeDNmaSAaymEU2cLJUBNAEpfmavs lvjg== 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=0GXgbin1wM5tD9QHab0bjxqBxoyIQnKJbxMwrdj3eAo=; b=U7Hs7zJN31SnEfaBoqAbfqBoI8YjME5TXpxR5bD5u3KtpAlWI09UZa8Z/0E74vUMH5 HBFGFYBJpMJWTF9jdLKNWmei6lymRN0oAkZA/1gTYYPURh6zgbLS7BAIlfUrQkuFO8GE HfYQMuOj0KiUMiqe83YhiAIbvwT5mXctWIcrzi3laVZB4WQkEJXPlK1A4KAsB7PQPfzv yhd5+FZDWy+hN717KNiGiBTizNKPHuwvkI1EgYEV1mEeAyRY8kH/3K/quuAfSAWQz7Zp /SXYlpyhG6Zdta0Zd9GgoML8jPnCiLd+hjv9IG1GPBJLJc6Ob/qJp5N/djLD/iBR/0U7 SrzA== X-Gm-Message-State: APjAAAWZH2z+a9ksjY/HhjiOp7YQVRFIixAAgyHjd5kW9jYwxLLhturr Bo1QqzHsWZJ8IQN911xafOtzvO9gLJwutDtoZfw= X-Received: by 2002:a5d:9c46:: with SMTP id 6mr9784584iof.6.1563863291632; Mon, 22 Jul 2019 23:28:11 -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> In-Reply-To: <20190722160603.GY9224@smile.fi.intel.com> From: Bartosz Golaszewski Date: Tue, 23 Jul 2019 08:28:00 +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 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 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 =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 missing or= invalid.\n"); > > - } > > - return ret; > > - } > > - > > - return 0; > > -} > > Why not leave this function (perhaps with different name)? > > -- > With Best Regards, > Andy Shevchenko > > 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. Bart