diff options
author | Olof Johansson <olof@lixom.net> | 2018-05-14 22:27:02 +0200 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2018-05-14 22:27:02 +0200 |
commit | 4e7383e14e0562923c8fcb3b7edd88e663815c5f (patch) | |
tree | 8a5bbe3b2565ec3ad9fc6e6a048599454b70aa67 /drivers/memory | |
parent | Merge tag 'hisi-drivers-for-4.18' of git://github.com/hisilicon/linux-hisi in... (diff) | |
parent | memory: brcmstb: dpfe: Remove need for dpfe_dev (diff) | |
download | linux-4e7383e14e0562923c8fcb3b7edd88e663815c5f.tar.xz linux-4e7383e14e0562923c8fcb3b7edd88e663815c5f.zip |
Merge tag 'arm-soc/for-4.18/drivers' of https://github.com/Broadcom/stblinux into next/drivers
This pull request contains Broadcom ARM/ARM64/MIPS SoCs drivers changes
for 4.18, please pull the following:
- Florian removes the synthetic struct device in the DPFE driver which
was used to attach sysfs attributes and uses the platform_device we are
probed from instead.
* tag 'arm-soc/for-4.18/drivers' of https://github.com/Broadcom/stblinux:
memory: brcmstb: dpfe: Remove need for dpfe_dev
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/brcmstb_dpfe.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c index e9c1485c32b9..04599eccd604 100644 --- a/drivers/memory/brcmstb_dpfe.c +++ b/drivers/memory/brcmstb_dpfe.c @@ -176,7 +176,6 @@ struct private_data { void __iomem *dmem; void __iomem *imem; struct device *dev; - unsigned int index; struct mutex lock; }; @@ -674,10 +673,8 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct private_data *priv; - struct device *dpfe_dev; struct init_data init; struct resource *res; - u32 index; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -687,11 +684,6 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev) mutex_init(&priv->lock); platform_set_drvdata(pdev, priv); - /* Cell index is optional; default to 0 if not present. */ - ret = of_property_read_u32(dev->of_node, "cell-index", &index); - if (ret) - index = 0; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dpfe-cpu"); priv->regs = devm_ioremap_resource(dev, res); if (IS_ERR(priv->regs)) { @@ -715,35 +707,20 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev) ret = brcmstb_dpfe_download_firmware(pdev, &init); if (ret) - goto err; - - dpfe_dev = devm_kzalloc(dev, sizeof(*dpfe_dev), GFP_KERNEL); - if (!dpfe_dev) { - ret = -ENOMEM; - goto err; - } - - priv->dev = dpfe_dev; - priv->index = index; + return ret; - dpfe_dev->parent = dev; - dpfe_dev->groups = dpfe_groups; - dpfe_dev->of_node = dev->of_node; - dev_set_drvdata(dpfe_dev, priv); - dev_set_name(dpfe_dev, "dpfe%u", index); + ret = sysfs_create_groups(&pdev->dev.kobj, dpfe_groups); + if (!ret) + dev_info(dev, "registered.\n"); - ret = device_register(dpfe_dev); - if (ret) - goto err; + return ret; +} - dev_info(dev, "registered.\n"); +static int brcmstb_dpfe_remove(struct platform_device *pdev) +{ + sysfs_remove_groups(&pdev->dev.kobj, dpfe_groups); return 0; - -err: - dev_err(dev, "failed to initialize -- error %d\n", ret); - - return ret; } static const struct of_device_id brcmstb_dpfe_of_match[] = { @@ -758,6 +735,7 @@ static struct platform_driver brcmstb_dpfe_driver = { .of_match_table = brcmstb_dpfe_of_match, }, .probe = brcmstb_dpfe_probe, + .remove = brcmstb_dpfe_remove, .resume = brcmstb_dpfe_resume, }; |