summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2017-10-04 14:19:03 +0200
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-10-07 11:28:07 +0200
commitb8640c5b8bef7e24fe54d2713f4c91b563a65c55 (patch)
tree4cb4c1f4de1c3d1f8eb7cb78514e91f1cd6f14dc
parentmtd: nand: denali: fix setup_data_interface to meet tCCS delay (diff)
downloadlinux-b8640c5b8bef7e24fe54d2713f4c91b563a65c55.tar.xz
linux-b8640c5b8bef7e24fe54d2713f4c91b563a65c55.zip
mtd: nand: sh_flctl: Use of_device_get_match_data() helper
Use the of_device_get_match_data() helper instead of open coding. While at it, make config const so the cast can be dropped. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r--drivers/mtd/nand/sh_flctl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index e7f3c98487e6..3c5008a4f5f3 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -1094,14 +1094,11 @@ MODULE_DEVICE_TABLE(of, of_flctl_match);
static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
{
- const struct of_device_id *match;
- struct flctl_soc_config *config;
+ const struct flctl_soc_config *config;
struct sh_flctl_platform_data *pdata;
- match = of_match_device(of_flctl_match, dev);
- if (match)
- config = (struct flctl_soc_config *)match->data;
- else {
+ config = of_device_get_match_data(dev);
+ if (!config) {
dev_err(dev, "%s: no OF configuration attached\n", __func__);
return NULL;
}