mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: [PATCH 04/11] ASoC: tpa6130a2: remove support for platform data
Date: Tue, 15 Nov 2022 21:38:10 -0800	[thread overview]
Message-ID: <20221116053817.2929810-4-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20221116053817.2929810-1-dmitry.torokhov@gmail.com>

There are no users of tpa6130a2_platform_data in the mainline kernel,
remove it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 include/sound/tpa6130a2-plat.h | 17 -----------------
 sound/soc/codecs/tpa6130a2.c   | 18 ++++--------------
 2 files changed, 4 insertions(+), 31 deletions(-)
 delete mode 100644 include/sound/tpa6130a2-plat.h

diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h
deleted file mode 100644
index a60930e36e93..000000000000
--- a/include/sound/tpa6130a2-plat.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * TPA6130A2 driver platform header
- *
- * Copyright (C) Nokia Corporation
- *
- * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
- */
-
-#ifndef TPA6130A2_PLAT_H
-#define TPA6130A2_PLAT_H
-
-struct tpa6130a2_platform_data {
-	int power_gpio;
-};
-
-#endif
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 8c00db32996b..5f00bfc32917 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -14,7 +14,6 @@
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
-#include <sound/tpa6130a2-plat.h>
 #include <sound/soc.h>
 #include <sound/tlv.h>
 #include <linux/of.h>
@@ -218,16 +217,15 @@ MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);
 
 static int tpa6130a2_probe(struct i2c_client *client)
 {
-	struct device *dev;
+	struct device *dev = &client->dev;
 	struct tpa6130a2_data *data;
-	struct tpa6130a2_platform_data *pdata = client->dev.platform_data;
-	struct device_node *np = client->dev.of_node;
 	const struct i2c_device_id *id;
 	const char *regulator;
 	unsigned int version;
 	int ret;
 
-	dev = &client->dev;
+	if (!dev->of_node)
+		return -ENODEV;
 
 	data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
@@ -239,15 +237,7 @@ static int tpa6130a2_probe(struct i2c_client *client)
 	if (IS_ERR(data->regmap))
 		return PTR_ERR(data->regmap);
 
-	if (pdata) {
-		data->power_gpio = pdata->power_gpio;
-	} else if (np) {
-		data->power_gpio = of_get_named_gpio(np, "power-gpio", 0);
-	} else {
-		dev_err(dev, "Platform data not set\n");
-		dump_stack();
-		return -ENODEV;
-	}
+	data->power_gpio = of_get_named_gpio(dev->of_node, "power-gpio", 0);
 
 	i2c_set_clientdata(client, data);
 
-- 
2.38.1.431.g37b22c650d-goog


  parent reply	other threads:[~2022-11-16  5:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  5:38 [PATCH 01/11] ASoC: ak5386: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 02/11] ASoC: max98373: " Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 03/11] ASoC: tas5086: " Dmitry Torokhov
2022-11-16  5:38 ` Dmitry Torokhov [this message]
2022-11-16  5:38 ` [PATCH 05/11] ASoC: tpa6130a2: " Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 06/11] ASoC: tlv320aic32x4: remove support for platform data Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 07/11] ASoC: tlv320aic32x4: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 08/11] ASoC: dt-bindings: wcd9335: fix reset line polarity in example Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 09/11] ASoC: wcd9335: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 10/11] ASoC: dt-bindings: wcd938x: fix codec reset line polarity in example Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 11/11] ASoC: wcd938x: switch to using gpiod API Dmitry Torokhov
2023-03-08 18:11   ` Krzysztof Kozlowski
2022-11-16 10:36 ` [PATCH 01/11] ASoC: ak5386: " Mark Brown
2022-11-16 19:07   ` Dmitry Torokhov
2022-11-17 11:34     ` Mark Brown
2022-11-18  6:31       ` Dmitry Torokhov
2022-11-18 13:12         ` Mark Brown

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=20221116053817.2929810-4-dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®