Received: by 10.213.65.68 with SMTP id h4csp33951imn; Thu, 15 Mar 2018 15:44:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELs/DnjSZwtJAzo7di0I0mZB33Gf0J//3TCc0+kwPIhDRgZJTr70XeIk4JiRv+YHAw2uF09m X-Received: by 2002:a17:902:566:: with SMTP id 93-v6mr9560369plf.327.1521153875088; Thu, 15 Mar 2018 15:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521153875; cv=none; d=google.com; s=arc-20160816; b=flxUaEOY0JaS3KRssdKFf3kxqTrVLbN/JeK/wnwpGuFNPjRYfQ7Bgw+JlMDUYMGddh Mqu1mUPXbiL4Yqw5lBvXoKGR4z0ddiFk4NOL+cJM2kvQ8WE0q7oHLRrNHUmiXSNjM91I KPr/Pq9isj0OY7bh3SCcu4/QWMCeAQGsp8iyY5sZVLcjJ1iVYyhZ220TX5kTjOH7A+Dm AReee9NjO/L6RovXkL1QC4ie/HIPCOJ1Gu2KjlDVPkDag3lnJDNNDH2rL7DP76QUesxU ct4CcsGuecAZWtBVF25ukiQW4vovRbe61zV32Bw/6oE8ek1gqXnnEzIOKaJQCwf826RU gt3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=QrTUii+MklQX3oQ+sjrrFdQ62+6O0v+KDwFMxjURdW4=; b=JAdO+HWh0srk24wR16lFLKLWsrgsWh7CZTpG7dIen/zIsS+xb+b12ivThTdIGtF42k HWqe3chQRG+gK9tOydfkU9cI8JTR29kjMjp9unuEVXn33ZhJLUH/ZFohT9GfQgVeoCL9 SAnbvjS+V38WKaoLL6UMPNnPtUSqHcQ8kp1NYHMeqVz/AAhwPLfRxeg6+geQd7QPLFBF VkaBK2KmGiEIktB0HgM94vGrRxftPi9kGsnhG+9n2bPWQRsY9Y4XIIBGmBgrqp7PvZlL 3xMd7oiZBgWfn6Lb73oLLdK1mtD57F2rtV0jK71MMkK/2YTdB2+VJUTbK0EbOWFFOWiQ +VzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UaoJMtiT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v34-v6si4757261plg.402.2018.03.15.15.44.10; Thu, 15 Mar 2018 15:44:35 -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=@gmail.com header.s=20161025 header.b=UaoJMtiT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932766AbeCOWmN (ORCPT + 99 others); Thu, 15 Mar 2018 18:42:13 -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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.16.2.804.g6dcf76e118-goog