[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191029014523.GH15259@lunn.ch>
Date: Tue, 29 Oct 2019 02:45:23 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Ioana Ciornei <ioana.ciornei@....com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
laurentiu.tudor@....com, f.fainelli@...il.com,
linux@...linux.org.uk
Subject: Re: [PATCH net-next v3 2/5] bus: fsl-mc: add the fsl_mc_get_endpoint
function
> +struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev)
> +{
> + struct fsl_mc_device *mc_bus_dev, *endpoint;
> + struct fsl_mc_obj_desc endpoint_desc = { 0 };
> + struct dprc_endpoint endpoint1 = { 0 };
> + struct dprc_endpoint endpoint2 = { 0 };
> + int state, err;
> +
> + mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
> + strcpy(endpoint1.type, mc_dev->obj_desc.type);
> + endpoint1.id = mc_dev->obj_desc.id;
> +
> + err = dprc_get_connection(mc_bus_dev->mc_io, 0,
> + mc_bus_dev->mc_handle,
> + &endpoint1, &endpoint2,
> + &state);
> +
> + if (err == -ENOTCONN || state == -1)
> + return NULL;
> +
> + if (err < 0) {
> + dev_err(&mc_bus_dev->dev, "dprc_get_connection() = %d\n", err);
> + return NULL;
> + }
You could return these errors with ERR_PRT(err)
Andrew
Powered by blists - more mailing lists