Thread (28 messages) 28 messages, 5 authors, 7d ago

Re: [PATCH v5 1/6] PCI: spacemit-k1: Add device data support

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2026-09-10 06:43:06
Also in: linux-pci, linux-riscv, lkml, spacemit

On Thu, Sep 10, 2026 at 05:44:50AM +0000, Yao Zi wrote:
On Wed, Sep 09, 2026 at 04:00:33PM +0800, Inochi Amaoto wrote:
quoted
On Tue, Sep 08, 2026 at 01:26:44PM +0300, Andy Shevchenko wrote:
quoted
On Mon, Sep 07, 2026 at 07:26:00PM +0800, Inochi Amaoto wrote:
...
quoted
quoted
quoted
+	data = device_get_match_data(dev);
+	if (!data)
+		return -ENODEV;
It's better to use -ENODATA which will help to distinguish from other ENODEV
cases (which are more often to happen).
OK, thanks
Honestly, I don't think this should even happen, since every compatible
supported by the driver carries its own of_match_data, and failing to
do so is obviously a driver bug, so I think this branch could be
dropped.
Does this driver do not support driver_override? How comes?

(Note, Sashiko is full of the issues of not checking for NULL the matching data
 and hence it describes a scenario in which this leads to NULL pointer
 dereference.)

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help