Skip to content

Commit fa43e99

Browse files
bebarinoKalle Valo
authored andcommitted
ath10k: Use device_get_match_data() to simplify code
Use device_get_match_data() here to simplify the code a bit. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 79a4b78 commit fa43e99

File tree

1 file changed

+4
-7
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+4
-7
lines changed

drivers/net/wireless/ath/ath10k/snoc.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,23 +1466,20 @@ MODULE_DEVICE_TABLE(of, ath10k_snoc_dt_match);
14661466
static int ath10k_snoc_probe(struct platform_device *pdev)
14671467
{
14681468
const struct ath10k_snoc_drv_priv *drv_data;
1469-
const struct of_device_id *of_id;
14701469
struct ath10k_snoc *ar_snoc;
14711470
struct device *dev;
14721471
struct ath10k *ar;
14731472
u32 msa_size;
14741473
int ret;
14751474
u32 i;
14761475

1477-
of_id = of_match_device(ath10k_snoc_dt_match, &pdev->dev);
1478-
if (!of_id) {
1479-
dev_err(&pdev->dev, "failed to find matching device tree id\n");
1476+
dev = &pdev->dev;
1477+
drv_data = device_get_match_data(dev);
1478+
if (!drv_data) {
1479+
dev_err(dev, "failed to find matching device tree id\n");
14801480
return -EINVAL;
14811481
}
14821482

1483-
drv_data = of_id->data;
1484-
dev = &pdev->dev;
1485-
14861483
ret = dma_set_mask_and_coherent(dev, drv_data->dma_mask);
14871484
if (ret) {
14881485
dev_err(dev, "failed to set dma mask: %d\n", ret);

0 commit comments

Comments
 (0)