[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB2800DA31D3CBF552B4B77FB9E0610@VI1PR0402MB2800.eurprd04.prod.outlook.com>
Date: Tue, 29 Oct 2019 09:26:02 +0000
From: Ioana Ciornei <ioana.ciornei@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Laurentiu Tudor <laurentiu.tudor@....com>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"linux@...linux.org.uk" <linux@...linux.org.uk>
Subject: RE: [PATCH net-next v3 2/5] bus: fsl-mc: add the fsl_mc_get_endpoint
function
> 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
I could but the caller would still take the same action disregarding the actual error code.
I don't find it really useful to return ERR_PTR().
Ioana
Powered by blists - more mailing lists