Commit b8640c5b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Boris Brezillon

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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 7963f58c
...@@ -1094,14 +1094,11 @@ MODULE_DEVICE_TABLE(of, of_flctl_match); ...@@ -1094,14 +1094,11 @@ MODULE_DEVICE_TABLE(of, of_flctl_match);
static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev) static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
{ {
const struct of_device_id *match; const struct flctl_soc_config *config;
struct flctl_soc_config *config;
struct sh_flctl_platform_data *pdata; struct sh_flctl_platform_data *pdata;
match = of_match_device(of_flctl_match, dev); config = of_device_get_match_data(dev);
if (match) if (!config) {
config = (struct flctl_soc_config *)match->data;
else {
dev_err(dev, "%s: no OF configuration attached\n", __func__); dev_err(dev, "%s: no OF configuration attached\n", __func__);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment