Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp69360pxk; Wed, 30 Sep 2020 18:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhUb6+yX/rNm5fc7PGMwZk53BbJseqIe/ijjh+qyEU3SQT05zJop8IstARS/fLesBT1HmW X-Received: by 2002:a17:906:394:: with SMTP id b20mr4398365eja.513.1601514708772; Wed, 30 Sep 2020 18:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601514708; cv=none; d=google.com; s=arc-20160816; b=QTSR6HuE0t8G75dLcWQC2dL1pY+lwt1gZ1Ncm2qt97SLuWEEgwgxMybkTYDRUKmK5Z ywDbAyOdI0Bv1hj7tMpa7EN9LjfJBj/UqgyO/WfCG4CGPaYCnH/+aJN/GDwWfvmKm8vh PKh6ivKNMOwYl9U5AZgFVq5GPqwanLqg7BmPmyWsTf58/fUgqL2RpsFcSvI0Ik1CGD7i C9nJOAoZN0o5wRRtBHdwUvwVmcp+6BtRsAfU9pY2/oRUlez1EUVS5CEuiJ/UGV8VaXLF XSgmibe/jhaseUz7Qn4NGpZQHgwU1TFhUjvrYSDp9DgcN/hI5Z0KKwTgRRai/+EJy7/I tGFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Yd7CWEqQfCr2cj7du2r2sQGpP6Y5AkxoHS268rhIDzY=; b=rkP4Fao/BxE0ewPAff/MyGEY2GECj4bb9Z98e+E5eWNxrhdE12dqWLXQV0rPMBnJsu VLD8+0GLFdoi+vFtTLveJgeHwOO6wtGah0TxXKWkX2F7HmnAY+xR3aQibeQ2ONkgpFiE jwiViirMam9MvR0/zWYB/bIkWqqZxOtk9h7V0g6VbRhOnE4jDeeRjZobnIDP2jbEWpWa nCj7bd/j7DHpMffPairJAdTCl/usAyc1xsXyU919FWHkr71Uf/ll89pxGTAFzOodOCHr pbxlD+fGsVSKDRc+kaBMM9a+RsRdlRT9G2uMZsFlTWVqyk0Ixfs4zcuCWmG6caLyN6PO J0Ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f26si2191653edx.455.2020.09.30.18.11.16; Wed, 30 Sep 2020 18:11:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731980AbgI3Xrv (ORCPT + 99 others); Wed, 30 Sep 2020 19:47:51 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:38083 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgI3Xrv (ORCPT ); Wed, 30 Sep 2020 19:47:51 -0400 Received: from methusalix.internal.home.lespocky.de ([92.117.51.117]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MBDrM-1kGeY90zPi-00CgJ0; Thu, 01 Oct 2020 01:47:23 +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 1kNlod-0007Z0-T1; Thu, 01 Oct 2020 01:47:21 +0200 Received: (nullmailer pid 7728 invoked by uid 2001); Wed, 30 Sep 2020 23:47:19 -0000 From: Alexander Dahl To: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org Cc: Pavel Machek , Dan Murphy , Rob Herring , Alexander Dahl , Peter Ujfalusi , Jacek Anaszewski , Alexander Dahl , Denis Osterland-Heim , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH v6 1/7] leds: pwm: Remove platform_data support Date: Thu, 1 Oct 2020 01:46:31 +0200 Message-Id: <20200930234637.7573-2-post@lespocky.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930234637.7573-1-post@lespocky.de> References: <20200930234637.7573-1-post@lespocky.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scan-Signature: 257374c4a781fc070d55e21f439eb91a X-Spam-Score: -2.8 (--) X-Provags-ID: V03:K1:jOBjAF/CkF48hBbOCUr5Z1QgpCLc02GeaEYNbCwJ99PA1LLbkiZ xHzp1rqs9sSPt1xHxyhq4jLizqlO9LFAw++h6YE0LN//pXOKbLHkKBiiiGwmFPlz7CdFDLg JNaqS1r+44GEpZCiXEfTEmJDd8Qp1ji40AAzKG+i3m1nCi1cNdsx/EgsVuJ4zuovoJNDa6y dgbxd+LBEval1wn5/02LQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:GSF88Ru63gE=:fVUBUUaVYcOB8FBvPO/ppG wJ59KSFdKkPsDDQGJulkZ5RoXmTDDno1WSs/s35+AqRr9FKp6arQHplZDE21a7pYiwtgllW5f Iz4fjCCTRN5u17zN4sswYwd+eQqtN0wgC/GeJh3iLP/0u7qw9IliGjLSWXZEvbFjKpT4W71Yy y6DigH3OgpQzKihT4hSu5Rz2tBRCkajY8u0zKaU9Qm0kDCY8uL3qQ4qU49vq11zwA1uxz0be9 0gA0tBAVQrEaH2Azi1eiQnDL29uTWE3NUyVa91wMRJuqeQfQnJEcGqUYRH99H+ID+iZx2UXSX 135mff55LNYdB51u1Q8ewbc69X7R3jejwgV/oS2uVMU78KzrzBTPIDiP2/CYmBmNq2ROPQN+X rlPaV8YVwJlkzpzfhycj/dy/sJKJONYJuqi80chS0VIIOpvElOpa9C4g99xISgXTnT+g++y8o 5MVXRv3HFv3re8X4xU87/qXhDSz4cI5Xd4cXj0LkejP52cP0NQEAdDpu7n27WbzFRAicuHyJQ JGGQJMnjBQjuYqBEdAIpw0g7UvhNi6+AYteUj6D+eI7eMe4mO/iC/OwZhz/xBQFu5swmtmxp+ 37JYjxZeCRLfQXSso6sY76nyyu7+MaJR4QtOW/dzjgI61Rg8hjgO78AGQAVBKNbDqMDnegHGA v21NWOYBOO+ELiQ75QGMhBDYJyheeAhgj7KgZlT/crfVomMf/89fWO5ExILEQ40RXA3DUHoEJ +PvwlulIjGeMh4OkzpSFeh6K+sJNwiz7XSwpH2K5IQPxwzeStDqTJdSd2C4XvCI+ch4LzcVgK qmlUPtqBhjiIEV5MW9QoH1MskQUCHctAMNH81W+xNDO0usOJkcQwuIhlKPm5rs/NATCucwJ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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: 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) 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; -- 2.20.1