Skip to content

Commit 8b9b08b

Browse files
ye xingchenJassiBrar
authored andcommitted
mailbox: rockchip: Use device_get_match_data() to simplify the code
Directly get the match data with device_get_match_data(). Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 76f708f commit 8b9b08b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/mailbox/rockchip-mailbox.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,14 @@ MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match);
164164
static int rockchip_mbox_probe(struct platform_device *pdev)
165165
{
166166
struct rockchip_mbox *mb;
167-
const struct of_device_id *match;
168167
const struct rockchip_mbox_data *drv_data;
169168
struct resource *res;
170169
int ret, irq, i;
171170

172171
if (!pdev->dev.of_node)
173172
return -ENODEV;
174173

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

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

0 commit comments

Comments
 (0)