Skip to content

Commit 9b26ed1

Browse files
dtorStefan-Schmidt
authored andcommitted
ieee802154: at86rf230: drop support for platform data
There are no users of platform data in the mainline tree, and new boards should use either ACPI or device tree, so let's stop supporting it. This will help with converting the driver to gpiod API. Signed-off-by: Dmitry Torokhov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 9f2ad95 commit 9b26ed1

File tree

2 files changed

+11
-51
lines changed

2 files changed

+11
-51
lines changed

drivers/net/ieee802154/at86rf230.c

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <linux/irq.h>
1818
#include <linux/gpio.h>
1919
#include <linux/delay.h>
20+
#include <linux/property.h>
2021
#include <linux/spi/spi.h>
21-
#include <linux/spi/at86rf230.h>
2222
#include <linux/regmap.h>
2323
#include <linux/skbuff.h>
2424
#include <linux/of_gpio.h>
@@ -1415,32 +1415,6 @@ static int at86rf230_hw_init(struct at86rf230_local *lp, u8 xtal_trim)
14151415
return at86rf230_write_subreg(lp, SR_SLOTTED_OPERATION, 0);
14161416
}
14171417

1418-
static int
1419-
at86rf230_get_pdata(struct spi_device *spi, int *rstn, int *slp_tr,
1420-
u8 *xtal_trim)
1421-
{
1422-
struct at86rf230_platform_data *pdata = spi->dev.platform_data;
1423-
int ret;
1424-
1425-
if (!IS_ENABLED(CONFIG_OF) || !spi->dev.of_node) {
1426-
if (!pdata)
1427-
return -ENOENT;
1428-
1429-
*rstn = pdata->rstn;
1430-
*slp_tr = pdata->slp_tr;
1431-
*xtal_trim = pdata->xtal_trim;
1432-
return 0;
1433-
}
1434-
1435-
*rstn = of_get_named_gpio(spi->dev.of_node, "reset-gpio", 0);
1436-
*slp_tr = of_get_named_gpio(spi->dev.of_node, "sleep-gpio", 0);
1437-
ret = of_property_read_u8(spi->dev.of_node, "xtal-trim", xtal_trim);
1438-
if (ret < 0 && ret != -EINVAL)
1439-
return ret;
1440-
1441-
return 0;
1442-
}
1443-
14441418
static int
14451419
at86rf230_detect_device(struct at86rf230_local *lp)
14461420
{
@@ -1548,26 +1522,32 @@ static int at86rf230_probe(struct spi_device *spi)
15481522
struct at86rf230_local *lp;
15491523
unsigned int status;
15501524
int rc, irq_type, rstn, slp_tr;
1551-
u8 xtal_trim = 0;
1525+
u8 xtal_trim;
15521526

15531527
if (!spi->irq) {
15541528
dev_err(&spi->dev, "no IRQ specified\n");
15551529
return -EINVAL;
15561530
}
15571531

1558-
rc = at86rf230_get_pdata(spi, &rstn, &slp_tr, &xtal_trim);
1532+
rc = device_property_read_u8(&spi->dev, "xtal-trim", &xtal_trim);
15591533
if (rc < 0) {
1560-
dev_err(&spi->dev, "failed to parse platform_data: %d\n", rc);
1561-
return rc;
1534+
if (rc != -EINVAL) {
1535+
dev_err(&spi->dev,
1536+
"failed to parse xtal-trim: %d\n", rc);
1537+
return rc;
1538+
}
1539+
xtal_trim = 0;
15621540
}
15631541

1542+
rstn = of_get_named_gpio(spi->dev.of_node, "reset-gpio", 0);
15641543
if (gpio_is_valid(rstn)) {
15651544
rc = devm_gpio_request_one(&spi->dev, rstn,
15661545
GPIOF_OUT_INIT_HIGH, "rstn");
15671546
if (rc)
15681547
return rc;
15691548
}
15701549

1550+
slp_tr = of_get_named_gpio(spi->dev.of_node, "sleep-gpio", 0);
15711551
if (gpio_is_valid(slp_tr)) {
15721552
rc = devm_gpio_request_one(&spi->dev, slp_tr,
15731553
GPIOF_OUT_INIT_LOW, "slp_tr");

include/linux/spi/at86rf230.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)