Commit 8b9b08bd authored by ye xingchen's avatar ye xingchen Committed by Jassi Brar
Browse files

mailbox: rockchip: Use device_get_match_data() to simplify the code



Directly get the match data with device_get_match_data().

Signed-off-by: default avatarye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 76f708f6
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -164,7 +164,6 @@ MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match);
static int rockchip_mbox_probe(struct platform_device *pdev)
static int rockchip_mbox_probe(struct platform_device *pdev)
{
{
	struct rockchip_mbox *mb;
	struct rockchip_mbox *mb;
	const struct of_device_id *match;
	const struct rockchip_mbox_data *drv_data;
	const struct rockchip_mbox_data *drv_data;
	struct resource *res;
	struct resource *res;
	int ret, irq, i;
	int ret, irq, i;
@@ -172,8 +171,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev)
	if (!pdev->dev.of_node)
	if (!pdev->dev.of_node)
		return -ENODEV;
		return -ENODEV;


	match = of_match_node(rockchip_mbox_of_match, pdev->dev.of_node);
	drv_data = (const struct rockchip_mbox_data *) device_get_match_data(&pdev->dev);
	drv_data = (const struct rockchip_mbox_data *)match->data;


	mb = devm_kzalloc(&pdev->dev, sizeof(*mb), GFP_KERNEL);
	mb = devm_kzalloc(&pdev->dev, sizeof(*mb), GFP_KERNEL);
	if (!mb)
	if (!mb)