From patchwork Thu Mar 15 22:41:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 10285871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61F8660621 for ; Thu, 15 Mar 2018 22:42:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E3EF28C8F for ; Thu, 15 Mar 2018 22:42:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4298F28C90; Thu, 15 Mar 2018 22:42:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA81128C91 for ; Thu, 15 Mar 2018 22:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932670AbeCOWmJ (ORCPT ); Thu, 15 Mar 2018 18:42:09 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:36108 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932641AbeCOWmH (ORCPT ); Thu, 15 Mar 2018 18:42:07 -0400 Received: by mail-pl0-f67.google.com with SMTP id 61-v6so4704163plf.3; Thu, 15 Mar 2018 15:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QrTUii+MklQX3oQ+sjrrFdQ62+6O0v+KDwFMxjURdW4=; b=UaoJMtiTPvVtNGBwTSd2WMEVuv8QKKZmc//VTvwJ30i24ueEWj2ZjajQBVgtVpQUQI uhgcfuDU7AbMT37H35hONy8DzSbq4+Phcdp9C49j7mWoa8QICBj/79ohhewnhfu/5m6G BWvZkwWYBVGX0ElmRe13W536kkofyrDxBgeCbC1gqtlU20V7K0bnP3l0g1zK4/4axRvH ypHrJGEkrFTrLHpm148SfuSX75lbtWF3EaWmCqEFbSlx9XtgIIRKf6xI73c2ZCFcoU2X r7fOj5SChsRPkY62it3hVCu1YKOW3pw4HPuwxyWkaXYfS+FdKP8n5OihMe8Y6gSN1oyZ KAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QrTUii+MklQX3oQ+sjrrFdQ62+6O0v+KDwFMxjURdW4=; b=egkHAfxH8rpGyIBo57A6L1+O5VU7lgMzUMzNlMGeB6QVvHx8+rQRQ/qbu1ZlCDO1Za faIRVOuy+UPNt2tC/DRZhzQGkFOGjV3Re+ZSQyyZRUJsQ7HJmYiODW2l1gCs2E6FfDcy lDrl8BtN8PhzrusZHWOAy0tmKIYWyUeUMkGqCUa9edtqlpacKYMktjtTU2ELxjl2doop gXsyGjnfo0W0vDNYidH9h5wHv8DvR10Spg7lFsIIY5xwxCpeY7JHyc/JjQY/VPFAlXp4 NwNqWqs0OG2oOMjBXrjnMjaA8/0XbgYreAFnDRnnflf95tX9zBpw9pplhWkEkz1f2afr Vn0A== X-Gm-Message-State: AElRT7Fqbg5qrEXyoxUhJhSNXtgRmM/YATjYJwRAng9wa2wawEct7inW UbG/H59sKNHM0nbkLqoqS24= X-Google-Smtp-Source: AG47ELvR4jjVarhJCgEc2P3zZOKU2EjLV8/vVApm364I6QrdpqCTHV86QUAQU7lvpezlMOFSPlvVYQ== X-Received: by 2002:a17:902:8f96:: with SMTP id z22-v6mr9795356plo.169.1521153726872; Thu, 15 Mar 2018 15:42:06 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id c62sm4607888pfk.179.2018.03.15.15.42.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 15:42:06 -0700 (PDT) From: Dmitry Torokhov To: Laurent Pinchart , Lee Jones Cc: Daniel Thompson , Jingoo Han , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, Yoshinori Sato , Rich Felker , Linus Walleij Subject: [RFC 1/4] backlight: gpio_backlight: use generic device properties Date: Thu, 15 Mar 2018 15:41:59 -0700 Message-Id: <20180315224202.96668-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog In-Reply-To: <20180315224202.96668-1-dmitry.torokhov@gmail.com> References: <20180315224202.96668-1-dmitry.torokhov@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of using of_property_read_bool() switch to using device_property_read_bool() This will allow switching from platform data to device properties everywhere. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij --- drivers/video/backlight/gpio_backlight.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index e470da95d806f..173fc4aafb89b 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -61,11 +61,10 @@ static int gpio_backlight_probe_dt(struct platform_device *pdev, struct gpio_backlight *gbl) { struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; enum gpiod_flags flags; int ret; - gbl->def_value = of_property_read_bool(np, "default-on"); + 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); @@ -89,22 +88,15 @@ static int gpio_backlight_probe(struct platform_device *pdev) struct backlight_properties props; struct backlight_device *bl; struct gpio_backlight *gbl; - struct device_node *np = pdev->dev.of_node; int ret; - if (!pdata && !np) { - dev_err(&pdev->dev, - "failed to find platform data or device tree node.\n"); - return -ENODEV; - } - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) return -ENOMEM; gbl->dev = &pdev->dev; - if (np) { + if (!pdata) { ret = gpio_backlight_probe_dt(pdev, gbl); if (ret) return ret;