lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC Patch net-next v2 3/9] net: dsa: microchip: perform the compatibility check for dev probed
On Fri, May 13, 2022 at 03:52:13PM +0530, Arun Ramadoss wrote:
> +static int ksz_check_device_id(struct ksz_device *dev)
> +{
> + const struct ksz_chip_data *dt_chip_data;
> +
> + dt_chip_data = of_device_get_match_data(dev->dev);

And one other comment. You haven't converted ksz8863_smi.c to put
anything in struct of_device_id :: data, so that driver will dereference
NULL here.

> +
> + /* Check for Device Tree and Chip ID */
> + if (dt_chip_data->chip_id != dev->chip_id) {
> + dev_err(dev->dev,
> + "Device tree specifies chip %s but found %s, please fix it!\n",
> + dt_chip_data->dev_name, dev->info->dev_name);
> + return -ENODEV;
> + }
> +
> + return 0;
> +}

\
 
 \ /
  Last update: 2022-05-16 13:08    [W:0.157 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site