On Fri, Jan 22, 2021 at 05:48:12PM -0600, Shiraz Saleem wrote:

> +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

Reply via email to