[PATCH 1/2] Driver for Xilinx ZynqMP AXI Timeout Block (ATB)

Krzysztof Kozlowski krzk at kernel.org
Sun May 25 21:45:29 PDT 2025


On 26/05/2025 05:59, Krzysztof Kozlowski wrote:

...

>> +
>> +	return ret;
>> +}
>> +
>> +/**
>> + * read_dts - Read DTS configuration for the driver
>> + * @config: Pointer to driver configuration
>> + * @return: 0 on success, otherwise error code
>> + */
>> +static int read_dts(struct device *dev, struct atb_config *config)
>> +{
>> +	struct device_node *np;
>> +
>> +	np = of_find_node_by_name(NULL, MOD_NAME);
> 
> No, you cannot do such stuff.
> 
> Match properly your driver.
> 
>> +	if (!np) {
>> +		dev_err(dev, "unable to find device tree node '%s'", MOD_NAME);
> 
> So you will print such error on every machine, x86, arm (other vendors,
> like Qualcomm), riscv64?

I missed the point you added a driver, so obviously this won't print
messages needlessly, but it is just confusing. Looks not needed, because
your device driver should bind to specific node. Why do you need it?

Especially that now you defined undocumented ABI for the node name.

> 
> 
> No, drop entirely.

Try to find a recently reviewed driver and use it as your template. This
entire code looks very different than others - including naming of
functions.


Best regards,
Krzysztof



More information about the linux-arm-kernel mailing list