diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-10-04 14:21:56 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-20 13:57:37 +0200 |
commit | 6e605a01501b20ba8ace196536899195c8d296f5 (patch) | |
tree | 8ea75df96fe978e2bc89d4f88d0b80bd4928f354 /drivers | |
parent | 263763c1c5235b01b654b954d4a278c8cf5a0def (diff) | |
download | linux-6e605a01501b20ba8ace196536899195c8d296f5.tar.gz |
serial: sh-sci: Use of_device_get_match_data() helper
Use the of_device_get_match_data() helper instead of open coding.
Note that when used with DT, there's always a valid match.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 9fde3df1b3a8..c4af4c40065b 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -40,6 +40,7 @@ #include <linux/module.h> #include <linux/mm.h> #include <linux/of.h> +#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/scatterlist.h> @@ -3073,17 +3074,15 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct plat_sci_port *p; struct sci_port *sp; + const void *data; int id; if (!IS_ENABLED(CONFIG_OF) || !np) return NULL; - match = of_match_node(of_sci_match, np); - if (!match) - return NULL; + data = of_device_get_match_data(&pdev->dev); p = devm_kzalloc(&pdev->dev, sizeof(struct plat_sci_port), GFP_KERNEL); if (!p) @@ -3099,8 +3098,8 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev, sp = &sci_ports[id]; *dev_id = id; - p->type = SCI_OF_TYPE(match->data); - p->regtype = SCI_OF_REGTYPE(match->data); + p->type = SCI_OF_TYPE(data); + p->regtype = SCI_OF_REGTYPE(data); sp->has_rtscts = of_property_read_bool(np, "uart-has-rtscts"); |