[PATCH v2] software node: Implement device_get_match_data fwnode callback

Sui Jingfeng sui.jingfeng at linux.dev
Wed Apr 24 10:51:47 UTC 2024


Hi,


On 2024/4/24 16:39, Dmitry Baryshkov wrote:
> Ok, what is the_bug_  that is being fixed by this patch?

I didn't have a way to use that driver under non DT environment,
this is the bug. Note: I demanding full features.

Both st7735r.c and repaper.c requires additional device property.

  - For st7735r.c: device_property_read_u32(dev, "rotation", &rotation);
  - For repaper.c: device_property_read_string(dev, "pervasive,thermal-zone", &thermal_zone)


Under non DT environment, those device properties can not be read.
Software node backend provided a way. Otherwise, the net results
of the patch doesn't meet the description in the commit message.

>   If you check
> the 'submitting-patches.rst', you'll find this phrase as a description
> of the Fixes: tag.

I have readthe 'submitting-patches.rst', the first sentence tell us that
"A Fixes: tag indicates that the patch fixes an issue in a previous commit."

So what's the problem?


>>>> Hence, before my patch is applied, the two "Make driver OF-independent" patch
>>>> have no effect. Using device_get_match_data() itself is exactly*same*  with
>>>> using of_device_get_match_data() as long as the .device_get_match_data hook is
>>>> not implemented.
> As far as I can see, repaper correctly handles the case by falling
> back to the spi_id. So does st7735r.c.


Yeah, this explicitly is the issue.

Falling back to other means is robust design, but it explicitly says
that the freshly addeddevice_get_match_data() don't works at all
under non DT environment. This is the bug, so what's you concern?
  
According to the commit message, the purpose of the introduction of
thedevice_get_match_data() is to achieve OF independent. But as you said, 
it will  fall back, then how does the goal "Make driver
OF-independent" can be achieved by the patch itself?


-- 
Best regards,
Sui



More information about the dri-devel mailing list