summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-03-27 15:54:23 +0200
committerArnd Bergmann <arnd@arndb.de>2018-03-27 15:54:23 +0200
commit3262b82d0ce66ca9af08ef2cdabc6ce418ebca28 (patch)
treedcadfdd4c83438afc2ae5a5eaa57f5ba76132865 /drivers/firmware
parent03836dd07f43a17b3681d3fc75ea40833fda49b6 (diff)
parentf842c41adc044e4586dd232c6e889f9d46180fa8 (diff)
downloadlinux-3262b82d0ce66ca9af08ef2cdabc6ce418ebca28.tar.bz2
Merge tag 'amlogic-drivers' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/drivers
Pull "Amlogic driver updates for v4.17" from Kevin Hilman: - socinfo: add more IDs for newer SoC detection - firmware: update init to use module_platform_driver_probe - soc: mix. VPU power controller fixes * tag 'amlogic-drivers' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: amlogic: meson-gx-socinfo: Update soc ids firmware: meson-sm: rework meson_sm_init to use module_platform_driver_probe meson-gx-socinfo: make local function meson_gx_socinfo_init static meson-mx-socinfo: Make local function meson_mx_socinfo_init() static soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferral
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/meson/meson_sm.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
index ff204421117b..0ec2ca87318c 100644
--- a/drivers/firmware/meson/meson_sm.c
+++ b/drivers/firmware/meson/meson_sm.c
@@ -17,8 +17,10 @@
#include <linux/arm-smccc.h>
#include <linux/bug.h>
#include <linux/io.h>
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/platform_device.h>
#include <linux/printk.h>
#include <linux/types.h>
#include <linux/sizes.h>
@@ -217,21 +219,11 @@ static const struct of_device_id meson_sm_ids[] = {
{ /* sentinel */ },
};
-int __init meson_sm_init(void)
+static int __init meson_sm_probe(struct platform_device *pdev)
{
const struct meson_sm_chip *chip;
- const struct of_device_id *matched_np;
- struct device_node *np;
- np = of_find_matching_node_and_match(NULL, meson_sm_ids, &matched_np);
- if (!np)
- return -ENODEV;
-
- chip = matched_np->data;
- if (!chip) {
- pr_err("unable to setup secure-monitor data\n");
- goto out;
- }
+ chip = of_match_device(meson_sm_ids, &pdev->dev)->data;
if (chip->cmd_shmem_in_base) {
fw.sm_shmem_in_base = meson_sm_map_shmem(chip->cmd_shmem_in_base,
@@ -257,4 +249,11 @@ out_in_base:
out:
return -EINVAL;
}
-device_initcall(meson_sm_init);
+
+static struct platform_driver meson_sm_driver = {
+ .driver = {
+ .name = "meson-sm",
+ .of_match_table = of_match_ptr(meson_sm_ids),
+ },
+};
+module_platform_driver_probe(meson_sm_driver, meson_sm_probe);