Thread (48 messages) 48 messages, 6 authors, 2026-01-29

Re: [PATCH v2 net-next 04/15] net: dsa: sja1105: prepare regmap for passing to child devices

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2026-01-22 13:42:51
Also in: linux-devicetree, lkml

On Thu, Jan 22, 2026 at 02:23:18PM +0200, Andy Shevchenko wrote:
On Thu, Jan 22, 2026 at 12:56:43PM +0200, Vladimir Oltean wrote:
quoted
Prepare a single regmap covering the entire SPI address space of the
SJA1105 and SJA1110 switches which can be given to MDIO buses, XPCS,
irqchip drivers etc.

This regmap is address-zero-based (can access the entire switch address
space) and child devices are supposed to access their respective memory
region with the help of struct resource (IORESOURCE_REG, to be precise).

Nothing is currently done with the regmap, it is just allocated and
added to the device's devres list, so it doesn't need to be freed.
...
quoted
--- a/drivers/net/dsa/sja1105/sja1105.h
+++ b/drivers/net/dsa/sja1105/sja1105.h
quoted
 #include <linux/dsa/8021q.h>
 #include <net/dsa.h>
 #include <linux/mutex.h>
+#include <linux/regmap.h>
+
 #include "sja1105_static_config.h"
It looks to me that somebody missed grouping above (not this change) and it's
better to have it done:

#include <linux/dsa/8021q.h>
#include <linux/mutex.h>
#include <linux/regmap.h>

#include <net/dsa.h>

#include "sja1105_static_config.h"
That somebody would be me, but I don't consider this a relevant change
for this patch set.
...
quoted
+	rc = devm_sja1105_create_regmap(priv);
+	if (rc < 0) {
+		dev_err(dev, "Failed to create regmap: %pe\n", ERR_PTR(rc));
+		return rc;
+	}
Hmm... Perhaps return dev_err_probe(...); ?
I never understood the point of dev_err_probe() when you know the return
code can never be -EPROBE_DEFER.
-- 
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