memory: ti-aemif: remove platform data support
There are no longer any users of the ti-aemif driver that set up platform data from board files. We can shrink the driver by removing support for it. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20240809-ti-aemif-v1-1-27b1e5001390@linaro.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
committed by
Krzysztof Kozlowski
parent
e3e4e77140
commit
8c38617722
@@ -17,7 +17,6 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/platform_data/ti-aemif.h>
|
||||
|
||||
#define TA_SHIFT 2
|
||||
#define RHOLD_SHIFT 4
|
||||
@@ -332,16 +331,11 @@ static int aemif_probe(struct platform_device *pdev)
|
||||
struct device_node *np = dev->of_node;
|
||||
struct device_node *child_np;
|
||||
struct aemif_device *aemif;
|
||||
struct aemif_platform_data *pdata;
|
||||
struct of_dev_auxdata *dev_lookup;
|
||||
|
||||
aemif = devm_kzalloc(dev, sizeof(*aemif), GFP_KERNEL);
|
||||
if (!aemif)
|
||||
return -ENOMEM;
|
||||
|
||||
pdata = dev_get_platdata(&pdev->dev);
|
||||
dev_lookup = pdata ? pdata->dev_lookup : NULL;
|
||||
|
||||
platform_set_drvdata(pdev, aemif);
|
||||
|
||||
aemif->clk = devm_clk_get(dev, NULL);
|
||||
@@ -358,8 +352,6 @@ static int aemif_probe(struct platform_device *pdev)
|
||||
|
||||
if (np && of_device_is_compatible(np, "ti,da850-aemif"))
|
||||
aemif->cs_offset = 2;
|
||||
else if (pdata)
|
||||
aemif->cs_offset = pdata->cs_offset;
|
||||
|
||||
aemif->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(aemif->base)) {
|
||||
@@ -381,11 +373,6 @@ static int aemif_probe(struct platform_device *pdev)
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else if (pdata && pdata->num_abus_data > 0) {
|
||||
for (i = 0; i < pdata->num_abus_data; i++, aemif->num_cs++) {
|
||||
aemif->cs_data[i].cs = pdata->abus_data[i].cs;
|
||||
aemif_get_hw_params(pdev, i);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < aemif->num_cs; i++) {
|
||||
@@ -403,22 +390,12 @@ static int aemif_probe(struct platform_device *pdev)
|
||||
*/
|
||||
if (np) {
|
||||
for_each_available_child_of_node(np, child_np) {
|
||||
ret = of_platform_populate(child_np, NULL,
|
||||
dev_lookup, dev);
|
||||
ret = of_platform_populate(child_np, NULL, NULL, dev);
|
||||
if (ret < 0) {
|
||||
of_node_put(child_np);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else if (pdata) {
|
||||
for (i = 0; i < pdata->num_sub_devices; i++) {
|
||||
pdata->sub_devices[i].dev.parent = dev;
|
||||
ret = platform_device_register(&pdata->sub_devices[i]);
|
||||
if (ret) {
|
||||
dev_warn(dev, "Error register sub device %s\n",
|
||||
pdata->sub_devices[i].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* TI DaVinci AEMIF platform glue.
|
||||
*
|
||||
* Copyright (C) 2017 BayLibre SAS
|
||||
*
|
||||
* Author:
|
||||
* Bartosz Golaszewski <bgolaszewski@baylibre.com>
|
||||
*/
|
||||
|
||||
#ifndef __TI_DAVINCI_AEMIF_DATA_H__
|
||||
#define __TI_DAVINCI_AEMIF_DATA_H__
|
||||
|
||||
#include <linux/of_platform.h>
|
||||
|
||||
/**
|
||||
* struct aemif_abus_data - Async bus configuration parameters.
|
||||
*
|
||||
* @cs - Chip-select number.
|
||||
*/
|
||||
struct aemif_abus_data {
|
||||
u32 cs;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct aemif_platform_data - Data to set up the TI aemif driver.
|
||||
*
|
||||
* @dev_lookup: of_dev_auxdata passed to of_platform_populate() for aemif
|
||||
* subdevices.
|
||||
* @cs_offset: Lowest allowed chip-select number.
|
||||
* @abus_data: Array of async bus configuration entries.
|
||||
* @num_abus_data: Number of abus entries.
|
||||
* @sub_devices: Array of platform subdevices.
|
||||
* @num_sub_devices: Number of subdevices.
|
||||
*/
|
||||
struct aemif_platform_data {
|
||||
struct of_dev_auxdata *dev_lookup;
|
||||
u32 cs_offset;
|
||||
struct aemif_abus_data *abus_data;
|
||||
size_t num_abus_data;
|
||||
struct platform_device *sub_devices;
|
||||
size_t num_sub_devices;
|
||||
};
|
||||
|
||||
#endif /* __TI_DAVINCI_AEMIF_DATA_H__ */
|
||||
Reference in New Issue
Block a user