Thread (17 messages) flat view 17 messages, 2 authors, 2021-01-14

Re: [PATCH v4 net-next 08/10] net: mscc: ocelot: register devlink ports

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-01-14 10:28:30

On Wed, Jan 13, 2021 at 07:30:33PM -0800, Jakub Kicinski wrote:
On Mon, 11 Jan 2021 19:43:14 +0200 Vladimir Oltean wrote:
quoted
+struct ocelot_devlink_private {
+	struct ocelot *ocelot;
+};
I don't think you ever explained to me why you don't put struct ocelot
in the priv.

-	ocelot = devm_kzalloc(&pdev->dev, sizeof(*ocelot), GFP_KERNEL);
-	if (!ocelot)
+	devlink = devlink_alloc(&ocelot_devlink_ops, sizeof(*ocelot));
+	if (!devlink)
                 return -ENOMEM;
+	ocelot = devlink_priv(ocelot->devlink);
Because that's not going to be all? The error path handling and teardown
all need to change, because I no longer use device-managed allocation,
and I wanted to avoid that.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help