Re: [PATCH 1/7] omap3isp: Ignore endpoints with invalid configuration
On Tue, Jul 18, 2017 at 01:03:33AM +0200, Sebastian Reichel wrote: > Hi, > > On Tue, Jul 18, 2017 at 01:01:10AM +0300, Sakari Ailus wrote: > > If endpoint has an invalid configuration, ignore it instead of happily > > proceeding to use it nonetheless. Ignoring such an endpoint is better than > > failing since there could be multiple endpoints, only some of which are > > bad. > > I would expect a dev_warn(dev, "Ignore endpoint (broken configuration)!"); Hmm. Perhaps I'll just drop this patch. This will be (hopefully) soon replaced by a framework function. -- Sakari Ailus e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
Re: [PATCH 1/7] omap3isp: Ignore endpoints with invalid configuration
Hi Sakari, Thank you for the patch. On Tuesday 18 Jul 2017 01:01:10 Sakari Ailus wrote: > If endpoint has an invalid configuration, ignore it instead of happily > proceeding to use it nonetheless. Ignoring such an endpoint is better than > failing since there could be multiple endpoints, only some of which are > bad. > > Signed-off-by: Sakari Ailus > Tested-by: Pavel Machek Reviewed-by: Laurent Pinchart > --- > drivers/media/platform/omap3isp/isp.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/omap3isp/isp.c > b/drivers/media/platform/omap3isp/isp.c index db2cccb57ceb..441eba1e02eb > 100644 > --- a/drivers/media/platform/omap3isp/isp.c > +++ b/drivers/media/platform/omap3isp/isp.c > @@ -2110,10 +2110,12 @@ static int isp_fwnodes_parse(struct device *dev, > if (!isd) > goto error; > > - notifier->subdevs[notifier->num_subdevs] = &isd->asd; > + if (isp_fwnode_parse(dev, fwnode, isd)) { > + devm_kfree(dev, isd); > + continue; > + } > > - if (isp_fwnode_parse(dev, fwnode, isd)) > - goto error; > + notifier->subdevs[notifier->num_subdevs] = &isd->asd; > > isd->asd.match.fwnode.fwnode = > fwnode_graph_get_remote_port_parent(fwnode); -- Regards, Laurent Pinchart
Re: [PATCH 1/7] omap3isp: Ignore endpoints with invalid configuration
Hi, On Tue, Jul 18, 2017 at 01:01:10AM +0300, Sakari Ailus wrote: > If endpoint has an invalid configuration, ignore it instead of happily > proceeding to use it nonetheless. Ignoring such an endpoint is better than > failing since there could be multiple endpoints, only some of which are > bad. I would expect a dev_warn(dev, "Ignore endpoint (broken configuration)!"); -- Sebastian > Signed-off-by: Sakari Ailus > Tested-by: Pavel Machek > --- > drivers/media/platform/omap3isp/isp.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/omap3isp/isp.c > b/drivers/media/platform/omap3isp/isp.c > index db2cccb57ceb..441eba1e02eb 100644 > --- a/drivers/media/platform/omap3isp/isp.c > +++ b/drivers/media/platform/omap3isp/isp.c > @@ -2110,10 +2110,12 @@ static int isp_fwnodes_parse(struct device *dev, > if (!isd) > goto error; > > - notifier->subdevs[notifier->num_subdevs] = &isd->asd; > + if (isp_fwnode_parse(dev, fwnode, isd)) { > + devm_kfree(dev, isd); > + continue; > + } > > - if (isp_fwnode_parse(dev, fwnode, isd)) > - goto error; > + notifier->subdevs[notifier->num_subdevs] = &isd->asd; > > isd->asd.match.fwnode.fwnode = > fwnode_graph_get_remote_port_parent(fwnode); > -- > 2.11.0 > signature.asc Description: PGP signature
[PATCH 1/7] omap3isp: Ignore endpoints with invalid configuration
If endpoint has an invalid configuration, ignore it instead of happily proceeding to use it nonetheless. Ignoring such an endpoint is better than failing since there could be multiple endpoints, only some of which are bad. Signed-off-by: Sakari Ailus Tested-by: Pavel Machek --- drivers/media/platform/omap3isp/isp.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index db2cccb57ceb..441eba1e02eb 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2110,10 +2110,12 @@ static int isp_fwnodes_parse(struct device *dev, if (!isd) goto error; - notifier->subdevs[notifier->num_subdevs] = &isd->asd; + if (isp_fwnode_parse(dev, fwnode, isd)) { + devm_kfree(dev, isd); + continue; + } - if (isp_fwnode_parse(dev, fwnode, isd)) - goto error; + notifier->subdevs[notifier->num_subdevs] = &isd->asd; isd->asd.match.fwnode.fwnode = fwnode_graph_get_remote_port_parent(fwnode); -- 2.11.0