mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@gmail.com>
To: tony@atomide.com, lee.jones@linaro.org
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] mfd: twl4030-audio: Drop legacy, non DT boot support
Date: Fri, 21 Oct 2022 11:12:18 +0300	[thread overview]
Message-ID: <20221021081218.2654-1-peter.ujfalusi@gmail.com> (raw)

Legacy or non DT boot is no longer possible on systems where the
tw4030/5030 is used.

Drop the support for handling legacy pdata.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
---
Hi,

Changes since v1:
- the node NULL check is dropped from the probe as it is redundant

Regards,
Peter

 drivers/mfd/twl4030-audio.c | 30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c
index 4536d829b43e..02865100b44d 100644
--- a/drivers/mfd/twl4030-audio.c
+++ b/drivers/mfd/twl4030-audio.c
@@ -144,14 +144,10 @@ unsigned int twl4030_audio_get_mclk(void)
 }
 EXPORT_SYMBOL_GPL(twl4030_audio_get_mclk);
 
-static bool twl4030_audio_has_codec(struct twl4030_audio_data *pdata,
-			      struct device_node *parent)
+static bool twl4030_audio_has_codec(struct device_node *parent)
 {
 	struct device_node *node;
 
-	if (pdata && pdata->codec)
-		return true;
-
 	node = of_get_child_by_name(parent, "codec");
 	if (node) {
 		of_node_put(node);
@@ -161,14 +157,10 @@ static bool twl4030_audio_has_codec(struct twl4030_audio_data *pdata,
 	return false;
 }
 
-static bool twl4030_audio_has_vibra(struct twl4030_audio_data *pdata,
-			      struct device_node *node)
+static bool twl4030_audio_has_vibra(struct device_node *node)
 {
 	int vibra;
 
-	if (pdata && pdata->vibra)
-		return true;
-
 	if (!of_property_read_u32(node, "ti,enable-vibra", &vibra) && vibra)
 		return true;
 
@@ -178,17 +170,11 @@ static bool twl4030_audio_has_vibra(struct twl4030_audio_data *pdata,
 static int twl4030_audio_probe(struct platform_device *pdev)
 {
 	struct twl4030_audio *audio;
-	struct twl4030_audio_data *pdata = dev_get_platdata(&pdev->dev);
 	struct device_node *node = pdev->dev.of_node;
 	struct mfd_cell *cell = NULL;
 	int ret, childs = 0;
 	u8 val;
 
-	if (!pdata && !node) {
-		dev_err(&pdev->dev, "Platform data is missing\n");
-		return -EINVAL;
-	}
-
 	audio = devm_kzalloc(&pdev->dev, sizeof(struct twl4030_audio),
 			     GFP_KERNEL);
 	if (!audio)
@@ -222,22 +208,14 @@ static int twl4030_audio_probe(struct platform_device *pdev)
 	audio->resource[TWL4030_AUDIO_RES_APLL].reg = TWL4030_REG_APLL_CTL;
 	audio->resource[TWL4030_AUDIO_RES_APLL].mask = TWL4030_APLL_EN;
 
-	if (twl4030_audio_has_codec(pdata, node)) {
+	if (twl4030_audio_has_codec(node)) {
 		cell = &audio->cells[childs];
 		cell->name = "twl4030-codec";
-		if (pdata) {
-			cell->platform_data = pdata->codec;
-			cell->pdata_size = sizeof(*pdata->codec);
-		}
 		childs++;
 	}
-	if (twl4030_audio_has_vibra(pdata, node)) {
+	if (twl4030_audio_has_vibra(node)) {
 		cell = &audio->cells[childs];
 		cell->name = "twl4030-vibra";
-		if (pdata) {
-			cell->platform_data = pdata->vibra;
-			cell->pdata_size = sizeof(*pdata->vibra);
-		}
 		childs++;
 	}
 
-- 
2.38.1


                 reply	other threads:[~2022-10-21  8:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221021081218.2654-1-peter.ujfalusi@gmail.com \
    --to=peter.ujfalusi@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®