Thread (80 messages) 80 messages, 6 authors, 2021-02-05

Re: [PATCH 07/22] RDMA/irdma: Register an auxiliary driver and implement private channel OPs

flat view

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-01-26 19:55:37
Also in: linux-rdma

On Fri, Jan 22, 2021 at 05:48:12PM -0600, Shiraz Saleem wrote:
quoted hunk ↗ jump to hunk
+static int irdma_probe(struct auxiliary_device *aux_dev,
+		       const struct auxiliary_device_id *id)
+{
+	struct irdma_drvdata *drvdata;
+	int ret;
+
+	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
+	if (!drvdata)
+		return -ENOMEM;
+
+	switch (id->driver_data) {
+	case IRDMA_GEN_2:
+		drvdata->init_dev = irdma_init_dev;
+		drvdata->deinit_dev = irdma_deinit_dev;
+		break;
+	case IRDMA_GEN_1:
+		drvdata->init_dev = i40iw_init_dev;
+		drvdata->deinit_dev = i40iw_deinit_dev;
+		break;
+	default:
+		ret = -ENODEV;
+		goto ver_err;
Also don't do this, if the drivers are so different then give them
different aux bus names and bind two drivers with the different
flow.

I suppose the old i40e can keep its weird registration thing, but ice
should not duplicate that, new code must use aux devices properly, as
in my other email.

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