Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1316761 > unrolled thread
| Started by | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| First post | 2016-01-25 15:40 +0100 |
| Last post | 2016-01-27 19:40 +0100 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] regulator: mt6397: Add platform and OF tables and fix module autoload Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-25 15:40 +0100
[PATCH 2/2] regulator: mt6397: Add OF match table Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-25 15:40 +0100
Applied "regulator: mt6397: Add OF match table" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-01-27 19:40 +0100
[PATCH 1/2] regulator: mt6397: Add platform device ID table Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-25 15:40 +0100
Applied "regulator: mt6397: Add platform device ID table" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-01-27 19:40 +0100
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-01-25 15:40 +0100 |
| Subject | [PATCH 0/2] regulator: mt6397: Add platform and OF tables and fix module autoload |
| Message-ID | <qUQtb-5oH-3@gated-at.bofh.it> |
Hello Mark, This small series add missing platform device and OF tables to the mt6397 regulator driver. I noticed these when reviewing a new regulator driver that was posted since the submitted driver had the same issues [0]. The patches were just built tested so testing on an actual HW will be highly appreciated. [0]: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1058808.html Best regards, Javier Javier Martinez Canillas (2): regulator: mt6397: Add platform device ID table regulator: mt6397: Add OF match table drivers/regulator/mt6397-regulator.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 2.5.0
[toc] | [next] | [standalone]
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-01-25 15:40 +0100 |
| Subject | [PATCH 2/2] regulator: mt6397: Add OF match table |
| Message-ID | <qUQtc-5oH-7@gated-at.bofh.it> |
| In reply to | #1316761 |
The Documentation/devicetree/bindings/regulator/mt6397-regulator.txt doc
mentions that a compatible "mediatek,mt6397-regulator" is required for
the MT6397 device node but the driver doesn't provide a OF match table so
the platform bus .match fallbacks to match using the driver name instead.
This also means that module auto-loading is broken for this driver since
the MFD driver that register the device, has a .of_compatible set so the
platform .uevent callback reports a OF modalias that's not in the module.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/regulator/mt6397-regulator.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c
index 585f0399a36b..17a5b6c2d6a9 100644
--- a/drivers/regulator/mt6397-regulator.c
+++ b/drivers/regulator/mt6397-regulator.c
@@ -323,9 +323,16 @@ static const struct platform_device_id mt6397_platform_ids[] = {
};
MODULE_DEVICE_TABLE(platform, mt6397_platform_ids);
+static const struct of_device_id mt6397_of_match[] = {
+ { .compatible = "mediatek,mt6397-regulator", },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, mt6397_of_match);
+
static struct platform_driver mt6397_regulator_driver = {
.driver = {
.name = "mt6397-regulator",
+ .of_match_table = of_match_ptr(mt6397_of_match),
},
.probe = mt6397_regulator_probe,
.id_table = mt6397_platform_ids,
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2016-01-27 19:40 +0100 |
| Subject | Applied "regulator: mt6397: Add OF match table" to the regulator tree |
| Message-ID | <qVDaz-7NJ-27@gated-at.bofh.it> |
| In reply to | #1316762 |
The patch
regulator: mt6397: Add OF match table
has been applied to the regulator tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
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
From abbf043b6508f6c90477a183b6975c269e913c7b Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier@osg.samsung.com>
Date: Mon, 25 Jan 2016 11:37:16 -0300
Subject: [PATCH] regulator: mt6397: Add OF match table
The Documentation/devicetree/bindings/regulator/mt6397-regulator.txt doc
mentions that a compatible "mediatek,mt6397-regulator" is required for
the MT6397 device node but the driver doesn't provide a OF match table so
the platform bus .match fallbacks to match using the driver name instead.
This also means that module auto-loading is broken for this driver since
the MFD driver that register the device, has a .of_compatible set so the
platform .uevent callback reports a OF modalias that's not in the module.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/mt6397-regulator.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c
index 585f0399a36b..17a5b6c2d6a9 100644
--- a/drivers/regulator/mt6397-regulator.c
+++ b/drivers/regulator/mt6397-regulator.c
@@ -323,9 +323,16 @@ static const struct platform_device_id mt6397_platform_ids[] = {
};
MODULE_DEVICE_TABLE(platform, mt6397_platform_ids);
+static const struct of_device_id mt6397_of_match[] = {
+ { .compatible = "mediatek,mt6397-regulator", },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, mt6397_of_match);
+
static struct platform_driver mt6397_regulator_driver = {
.driver = {
.name = "mt6397-regulator",
+ .of_match_table = of_match_ptr(mt6397_of_match),
},
.probe = mt6397_regulator_probe,
.id_table = mt6397_platform_ids,
--
2.7.0.rc3
[toc] | [prev] | [next] | [standalone]
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-01-25 15:40 +0100 |
| Subject | [PATCH 1/2] regulator: mt6397: Add platform device ID table |
| Message-ID | <qUQtc-5oH-11@gated-at.bofh.it> |
| In reply to | #1316761 |
The platform bus_type .match callback attempts to match the platform device
name with an entry on the .id_table if provided and fallbacks to match with
the driver's name if a table is not provided.
Using a platform device ID to match is more explicit, allows the driver to
support more than one device and also the MODULE_DEVICE_TABLE macro can be
used to export the module aliases information instead of the MODULE_ALIAS.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/regulator/mt6397-regulator.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c
index a5b2f4762677..585f0399a36b 100644
--- a/drivers/regulator/mt6397-regulator.c
+++ b/drivers/regulator/mt6397-regulator.c
@@ -317,11 +317,18 @@ static int mt6397_regulator_probe(struct platform_device *pdev)
return 0;
}
+static const struct platform_device_id mt6397_platform_ids[] = {
+ {"mt6397-regulator", 0},
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, mt6397_platform_ids);
+
static struct platform_driver mt6397_regulator_driver = {
.driver = {
.name = "mt6397-regulator",
},
.probe = mt6397_regulator_probe,
+ .id_table = mt6397_platform_ids,
};
module_platform_driver(mt6397_regulator_driver);
@@ -329,4 +336,3 @@ module_platform_driver(mt6397_regulator_driver);
MODULE_AUTHOR("Flora Fu <flora.fu@mediatek.com>");
MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6397 PMIC");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:mt6397-regulator");
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2016-01-27 19:40 +0100 |
| Subject | Applied "regulator: mt6397: Add platform device ID table" to the regulator tree |
| Message-ID | <qVDaA-7NJ-71@gated-at.bofh.it> |
| In reply to | #1316764 |
The patch
regulator: mt6397: Add platform device ID table
has been applied to the regulator tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
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
From 288a89bf436fa3682742d41b2bc1b243ff2ded85 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier@osg.samsung.com>
Date: Mon, 25 Jan 2016 11:37:15 -0300
Subject: [PATCH] regulator: mt6397: Add platform device ID table
The platform bus_type .match callback attempts to match the platform device
name with an entry on the .id_table if provided and fallbacks to match with
the driver's name if a table is not provided.
Using a platform device ID to match is more explicit, allows the driver to
support more than one device and also the MODULE_DEVICE_TABLE macro can be
used to export the module aliases information instead of the MODULE_ALIAS.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/mt6397-regulator.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c
index a5b2f4762677..585f0399a36b 100644
--- a/drivers/regulator/mt6397-regulator.c
+++ b/drivers/regulator/mt6397-regulator.c
@@ -317,11 +317,18 @@ static int mt6397_regulator_probe(struct platform_device *pdev)
return 0;
}
+static const struct platform_device_id mt6397_platform_ids[] = {
+ {"mt6397-regulator", 0},
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, mt6397_platform_ids);
+
static struct platform_driver mt6397_regulator_driver = {
.driver = {
.name = "mt6397-regulator",
},
.probe = mt6397_regulator_probe,
+ .id_table = mt6397_platform_ids,
};
module_platform_driver(mt6397_regulator_driver);
@@ -329,4 +336,3 @@ module_platform_driver(mt6397_regulator_driver);
MODULE_AUTHOR("Flora Fu <flora.fu@mediatek.com>");
MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6397 PMIC");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:mt6397-regulator");
--
2.7.0.rc3
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web