From patchwork Mon Oct 5 20:34:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 11817669 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C8406CA for ; Mon, 5 Oct 2020 20:37:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D0CF21534 for ; Mon, 5 Oct 2020 20:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qHYaxcJ3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D0CF21534 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lespocky.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rgYUIpryEi1hEwn59+/bsu1D/tiK7dYdQT9VQtUL22c=; b=qHYaxcJ3LHL0QGM9XsXoHYvTu x3WkKF1KiUd3DqEvxf5MDRriH5bVh/xBHDyCPD1JlZLCTzXoCuVb2AzQet58HaE+rhVAGHfE9G880 tKpIkBeiMQxzLfFVfByihokWHDTn5j5F88Zzyw5LOAYVoj6bIAj57R3J3zfnHLkPKNzMul+rEmrAt QxYLSsGW2zaFEuUyy84BiW4Vom7C6Egk/J7ZeV5s0P6AJcqZFcAZIz7E4Av0d/MaP58Gvu01khMiV GHgj8bxvzzlkyUFfYz+OnduB49D/hGXT2/VOriWoG8rNXIPsFFfnprUDMWXgXMkrVIYII7Et1tBHJ Np9SSEnlg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPXEj-0007Cf-6n; Mon, 05 Oct 2020 20:37:33 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPXDV-0006XA-Co; Mon, 05 Oct 2020 20:36:19 +0000 Received: from methusalix.internal.home.lespocky.de ([92.117.55.152]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mf0uq-1krT710Xnu-00gc2C; Mon, 05 Oct 2020 22:35:49 +0200 Received: from lemmy.internal.home.lespocky.de ([192.168.243.176] helo=lemmy.home.lespocky.de) by methusalix.internal.home.lespocky.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kPXD0-0004Vs-2D; Mon, 05 Oct 2020 22:35:47 +0200 Received: (nullmailer pid 10299 invoked by uid 2001); Mon, 05 Oct 2020 20:35:35 -0000 From: Alexander Dahl To: Pavel Machek , Dan Murphy , Rob Herring Subject: [PATCH v7 01/12] leds: pwm: Remove platform_data support Date: Mon, 5 Oct 2020 22:34:40 +0200 Message-Id: <20201005203451.9985-2-post@lespocky.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201005203451.9985-1-post@lespocky.de> References: <20201005203451.9985-1-post@lespocky.de> MIME-Version: 1.0 X-Scan-Signature: 60b617cbd4bf9c2e08b69b262f748e48 X-Spam-Score: -2.9 (--) X-Provags-ID: V03:K1:F6CgTq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enqDT+W+t9hlBIW86kFKkRDIcKp 7r7xrzNZi6L+vlKt/FWCmHM/PrxbfGJw1EMyW0qrs8fB7ujLAO/XY0VmcS9HjeU1LiAtIqw X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201005_163617_672178_592E417F X-CRM114-Status: GOOD ( 19.73 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.24 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.17.24 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Marek_Beh=C3=BAn?= , Alexander Dahl , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Denis Osterland-Heim , Alexander Dahl , Jacek Anaszewski , linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-leds@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Since commit 141f15c66d94 ("leds: pwm: remove header") that platform interface is not usable from outside and there seems to be no in tree user anymore. All in-tree users of the leds-pwm driver seem to use DT currently. Getting rid of the old platform interface allows the leds-pwm driver to switch over from 'devm_led_classdev_register()' to 'devm_led_classdev_register_ext()'. Signed-off-by: Alexander Dahl Cc: Denis Osterland-Heim Reviewed-by: Marek BehĂșn --- Notes: v6 -> v7: * (no changes on this patch) v5 -> v6: * added Reviewed-by from Marek * minimal commit message rewording, because a later patch was already applied v5: * added this patch to series (replacing another patch with a not working, different approach) drivers/leds/leds-pwm.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index 2a16ae0bf022..f53f9309ca6c 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -24,11 +24,6 @@ struct led_pwm { unsigned int max_brightness; }; -struct led_pwm_platform_data { - int num_leds; - struct led_pwm *leds; -}; - struct led_pwm_data { struct led_classdev cdev; struct pwm_device *pwm; @@ -60,6 +55,7 @@ static int led_pwm_set(struct led_classdev *led_cdev, return pwm_apply_state(led_dat->pwm, &led_dat->pwmstate); } +__attribute__((nonnull)) static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv, struct led_pwm *led, struct fwnode_handle *fwnode) { @@ -73,10 +69,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv, led_data->cdev.max_brightness = led->max_brightness; led_data->cdev.flags = LED_CORE_SUSPENDRESUME; - if (fwnode) - led_data->pwm = devm_fwnode_pwm_get(dev, fwnode, NULL); - else - led_data->pwm = devm_pwm_get(dev, led->name); + led_data->pwm = devm_fwnode_pwm_get(dev, fwnode, NULL); if (IS_ERR(led_data->pwm)) return dev_err_probe(dev, PTR_ERR(led_data->pwm), "unable to request PWM for %s\n", @@ -139,15 +132,11 @@ static int led_pwm_create_fwnode(struct device *dev, struct led_pwm_priv *priv) static int led_pwm_probe(struct platform_device *pdev) { - struct led_pwm_platform_data *pdata = dev_get_platdata(&pdev->dev); struct led_pwm_priv *priv; - int count, i; int ret = 0; + int count; - if (pdata) - count = pdata->num_leds; - else - count = device_get_child_node_count(&pdev->dev); + count = device_get_child_node_count(&pdev->dev); if (!count) return -EINVAL; @@ -157,16 +146,7 @@ static int led_pwm_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - if (pdata) { - for (i = 0; i < count; i++) { - ret = led_pwm_add(&pdev->dev, priv, &pdata->leds[i], - NULL); - if (ret) - break; - } - } else { - ret = led_pwm_create_fwnode(&pdev->dev, priv); - } + ret = led_pwm_create_fwnode(&pdev->dev, priv); if (ret) return ret;