pwm: core: Replace custom implementation of device_match_fwnode()
PATCH 1/1 pwm: core: Replace custom implementation of device_match_fwnode()
Replace custom implementation of the device_match_fwnode().
--- drivers/pwm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
@@ -678,7 +678,7 @@ static struct pwm_chip *fwnode_to_pwmchip(struct fwnode_handle *fwnode)mutex_lock (&pwm_lock);list_for_each_entry (chip, &pwm_chips, list) -if (chip->dev &&dev_fwnode (chip->dev) == fwnode) { +if (chip->dev &&device_match_fwnode (chip->dev, fwnode)) {mutex_unlock (&pwm_lock);return chip; }
Signature · 1 line
2.35.1
Quoted 6 lines · Andy Shevchenko
Replace custom implementation of the
device_match_fwnode().Signed-off-by Andy Shevchenko <[email protected]>--- drivers/pwm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I really don't see the point in having an exported symbol for this. It's a simple comparison and the result is even longer than the original. The *only* reason why this helper exists seems to be because it is getting used in *_find_device() callbacks.
Honestly, I don't see a reason why this should be applied. And frankly, why bother making all these changes. It's a waste of time, in my opinion.
Thierry
Quoted 5 lines · Thierry Reding
Quoted 1 line · Andy Shevchenko
Replace custom implementation of the
device_match_fwnode().I really don't see the point in having an exported symbol for this. It's a simple comparison and the result is even longer than the original.
Longer doesn't always mean worse.
Quoted 3 lines
The
*only* reason why this helper exists seems to be because it is getting used in*_find_device()callbacks.
Yes and no. Initially for the purpose to be a callback it can be reused. The point is that it hides the dev_fwnode() machinery behind and taking into account ongoing discussion about constification of the dev_fwnode() we might need to touch this or similar places to avoid problems with compiler.
Quoted 3 lines
Honestly, I don't see a reason why this should be applied. And frankly, why bother making all these changes. It's a waste of time, in my opinion.
Obviously I will not do it if I be with you on the same page. But okay, not a big deal in this case.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Thierry Reding
AppliedQuoted 13 lines · Andy Shevchenko
Quoted 5 lines · Thierry Reding
Quoted 1 line · Andy Shevchenko
Replace custom implementation of the
device_match_fwnode().I really don't see the point in having an exported symbol for this. It's a simple comparison and the result is even longer than the original.
Longer doesn't always mean worse.
Quoted 3 lines
The
*only* reason why this helper exists seems to be because it is getting used in*_find_device()callbacks.
Quoted 5 lines
Yes and no. Initially for the purpose to be a callback it can be reused. The point is that it hides the
dev_fwnode()machinery behind and taking into account ongoing discussion about constification of thedev_fwnode()we might need to touch this or similar places to avoid problems with compiler.
Maybe next time use that argument in the commit message. That's much more convincing than a useless "replace custom implementation" because that just makes it look like you're doing this to pass the time or something.
Applied, with a slightly updated commit message, thanks.
Thierry
Quoted 20 lines · Thierry Reding
Quoted 13 lines · Andy Shevchenko
Quoted 5 lines · Thierry Reding
Quoted 1 line · Andy Shevchenko
Replace custom implementation of the
device_match_fwnode().I really don't see the point in having an exported symbol for this. It's a simple comparison and the result is even longer than the original.
Longer doesn't always mean worse.
Quoted 3 lines
The
*only* reason why this helper exists seems to be because it is getting used in*_find_device()callbacks.Quoted 5 lines
Yes and no. Initially for the purpose to be a callback it can be reused. The point is that it hides the
dev_fwnode()machinery behind and taking into account ongoing discussion about constification of thedev_fwnode()we might need to touch this or similar places to avoid problems with compiler.
Quoted 4 lines
Maybe next time use that argument in the commit message. That's much more convincing than a useless "replace custom implementation" because that just makes it look like you're doing this to pass the time or something.
Noted.
Quoted 1 line
Applied, with a slightly updated commit message, thanks.
Thank you!
Signature · 2 lines
With Best Regards, Andy Shevchenko