Re: [PATCH 3/3] ASoC: ti: davinci-evm: Use of_device_get_match_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 14/08/2021 23:19, Aakash Hemadri wrote:
> Prefer `of_device_get_match_data` over `of_match_device`
> 
> Retrieve OF match data using `of_device_get_match_data`, this is cleaner
> and better expresses intent.
> 
> Signed-off-by: Aakash Hemadri <aakashhemadri123@xxxxxxxxx>
> ---
>  sound/soc/ti/davinci-evm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/ti/davinci-evm.c b/sound/soc/ti/davinci-evm.c
> index b043a0070d20..bf13f3d25cec 100644
> --- a/sound/soc/ti/davinci-evm.c
> +++ b/sound/soc/ti/davinci-evm.c
> @@ -389,7 +389,7 @@ static int davinci_evm_probe(struct platform_device *pdev)
>  	struct clk *mclk;
>  	int ret = 0;
>  
> -	match = of_match_device(of_match_ptr(davinci_evm_dt_ids), &pdev->dev);
> +	match = of_device_get_match_data(&pdev->dev);

incorrect,
of_device_get_match_data() is retrieving the match->data

>  	if (!match) {
>  		dev_err(&pdev->dev, "Error: No device match found\n");
>  		return -ENODEV;
> 

-- 
Péter



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux