Skip to content

driver core: add probe error check helper

Andrzej Hajda linux-arm-kernel lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 11 repliesIn review
  2. v32 of 4 patches 1 replySuperseded
  3. v22 of 3 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches16 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3driver core: add probe_err log helperdrivers/base/core.c include/linux/device.h+42 -018 replies
2/3driver core: add deferring probe reason to devices_deferred propertydrivers/base/base.h drivers/base/core.c drivers/base/dd.c+28 -54 replies
3/3driver core: add probe_err_ptr helperinclude/linux/device.h+2 -03 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMark BrownJavier Martinez CanillasAndy ShevchenkoRafael J. Wysocki
1/3R-b R-b R-b R-b R-b R-b
2/3R-b R-b R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/3] driver core: add probe error check helper

Hi Greg, Rafael,

This patchset proposes probe helper function which should simplify little bit resource acquisition error handling, it also extend it with adding defer probe reason to devices_deferred property:

This patchset is actually resend of the most important 1st and 2nd patch.

I have also attached patch adding probe_err_ptr - it will allow to replace quite frequent calls:

    probe_err(dev, PTR_ERR(ptr), ...)
with
    probe_err_ptr(dev, ptr, ...)

I have dropped the last patch showing usage of probe_err(_ptr)? as it is very big, should be split per subsystem, and should be applied after merge of patches introducing probe_err(_ptr) helpers.

Just for the record - my dirty cocci script generates patch which replaces code with probe_err* helpers with following stats (on linux_next branch):
1585 probe_err
1194 probe_err_ptr

   1638 files changed, 6487 insertions(+), 9163 deletions(-).

Of course there are much more places where probe_err* can be applied, the script tries to catch the most obvious ones.
More importantly probe_err should handle probe errors more correctly and uniformly than it is done now.

If this patchset will be accepted I will try to send patches introducing probe_err* per subsystem.

Regards
Andrzej

Andrzej Hajda (3):
driver core: add probe_err log helper
driver core: add deferring probe reason to devices_deferred property driver core: add probe_err_ptr helper

 drivers/base/base.h    |  3 +++
 drivers/base/core.c    | 40 ++++++++++++++++++++++++++++++++++++++++
 drivers/base/dd.c      | 21 ++++++++++++++++++++-
 include/linux/device.h |  5 +++++
 4 files changed, 68 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1