Re: [PATCH 05/14] drivers: net: dsa: qca8k: add support for qca8327 switch

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

 



> @@ -1467,11 +1468,16 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
>  		gpiod_set_value_cansleep(priv->reset_gpio, 0);
>  	}
>  
> +	/* get the switches ID from the compatible */
> +	data = of_device_get_match_data(&mdiodev->dev);
> +	if (!data)
> +		return -ENODEV;
> +
>  	/* read the switches ID register */
>  	id = qca8k_read(priv, QCA8K_REG_MASK_CTRL);
>  	id >>= QCA8K_MASK_CTRL_ID_S;
>  	id &= QCA8K_MASK_CTRL_ID_M;
> -	if (id != QCA8K_ID_QCA8337)
> +	if (id != data->id)
>  		return -ENODEV;

It is useful to print an error message here: Found X, expected
Y. Gives the DT writer an idea what they did wrong.

   Andrew



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux