aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/aspeed-video.c
diff options
context:
space:
mode:
authorJammy Huang <jammy_huang@aspeedtech.com>2022-02-14 16:09:09 +0800
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2022-02-22 09:41:11 +0100
commit9a5e6900cfa3f9653f5ab2a6715123b1e66f989d (patch)
treec27b14fa308a6f21215d47daca294733b21f6628 /drivers/media/platform/aspeed-video.c
parentmedia: aspeed: Use full swing as JFIF to fix incorrect color (diff)
downloadlinux-dev-9a5e6900cfa3f9653f5ab2a6715123b1e66f989d.tar.xz
linux-dev-9a5e6900cfa3f9653f5ab2a6715123b1e66f989d.zip
media: aspeed: Use of_device_get_match_data() helper
Use of_device_get_match_data() to simplify the code. Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform/aspeed-video.c')
-rw-r--r--drivers/media/platform/aspeed-video.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
index 77f88dce2575..f2e24e881a97 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
@@ -1961,7 +1962,6 @@ MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
static int aspeed_video_probe(struct platform_device *pdev)
{
const struct aspeed_video_config *config;
- const struct of_device_id *match;
struct aspeed_video *video;
int rc;
@@ -1973,11 +1973,10 @@ static int aspeed_video_probe(struct platform_device *pdev)
if (IS_ERR(video->base))
return PTR_ERR(video->base);
- match = of_match_node(aspeed_video_of_match, pdev->dev.of_node);
- if (!match)
- return -EINVAL;
+ config = of_device_get_match_data(&pdev->dev);
+ if (!config)
+ return -ENODEV;
- config = match->data;
video->jpeg_mode = config->jpeg_mode;
video->comp_size_read = config->comp_size_read;