* [RESEND PATCH] regulator: da9121: Use i2c_get_match_data()
@ 2023-10-17 20:34 Rob Herring
2023-10-17 23:41 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-10-17 20:34 UTC (permalink / raw)
To: Support Opensource, Liam Girdwood, Mark Brown; +Cc: linux-kernel
Use preferred i2c_get_match_data() instead of of_match_device() to get
the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/regulator/da9121-regulator.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index 80098035bb13..b551a400bdd1 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -13,7 +13,7 @@
//
// Copyright (C) 2020 Dialog Semiconductor
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/of_regulator.h>
@@ -1117,17 +1117,6 @@ static const struct of_device_id da9121_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, da9121_dt_ids);
-static inline int da9121_of_get_id(struct device *dev)
-{
- const struct of_device_id *id = of_match_device(da9121_dt_ids, dev);
-
- if (!id) {
- dev_err(dev, "%s: Failed\n", __func__);
- return -EINVAL;
- }
- return (uintptr_t)id->data;
-}
-
static int da9121_i2c_probe(struct i2c_client *i2c)
{
struct da9121 *chip;
@@ -1141,7 +1130,7 @@ static int da9121_i2c_probe(struct i2c_client *i2c)
}
chip->pdata = i2c->dev.platform_data;
- chip->subvariant_id = da9121_of_get_id(&i2c->dev);
+ chip->subvariant_id = (enum da9121_subvariant)i2c_get_match_data(i2c);
ret = da9121_assign_chip_model(i2c, chip);
if (ret < 0)
--
2.42.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND PATCH] regulator: da9121: Use i2c_get_match_data()
2023-10-17 20:34 [RESEND PATCH] regulator: da9121: Use i2c_get_match_data() Rob Herring
@ 2023-10-17 23:41 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-10-17 23:41 UTC (permalink / raw)
To: Support Opensource, Liam Girdwood, Rob Herring; +Cc: linux-kernel
On Tue, 17 Oct 2023 15:34:28 -0500, Rob Herring wrote:
> Use preferred i2c_get_match_data() instead of of_match_device() to get
> the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/1] regulator: da9121: Use i2c_get_match_data()
commit: 46537a8676d6555141c4b98ec1bf5f3eea971128
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-17 23:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 20:34 [RESEND PATCH] regulator: da9121: Use i2c_get_match_data() Rob Herring
2023-10-17 23:41 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox