Here, dss_init_ports is not handling return error form
dpi_init_port and sdi_init_port. Now dss_init_ports is returning
always 0. And it's making below code as a dead code.
static int dss_bind(struct device *dev)
{
.
.
r = dss_init_ports(pdev); //dss_init_ports will return always 0
if (r)// This condition will always false
goto err_init_ports; //Dead Code
.
.
}
This change is to handle return error from dpi_init_port and
sdi_init_port. Also, It will remove dead code from function 'dss_bind'.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/video/fbdev/omap2/omapfb/dss/dss.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Hi,
On Thursday, February 09, 2017 03:28:01 PM Arvind Yadav wrote:
Here, dss_init_ports is not handling return error form
dpi_init_port and sdi_init_port. Now dss_init_ports is returning
always 0. And it's making below code as a dead code.
static int dss_bind(struct device *dev)
{
.
.
r = dss_init_ports(pdev); //dss_init_ports will return always 0
if (r)// This condition will always false
goto err_init_ports; //Dead Code
.
.
}
This change is to handle return error from dpi_init_port and
sdi_init_port. Also, It will remove dead code from function 'dss_bind'.
Signed-off-by: Arvind Yadav <redacted>
---
Please include version history here when submitting new
versions.
@@ -946,6 +946,7 @@ static int dss_init_ports(struct platform_device *pdev)structdevice_node*parent=pdev->dev.of_node;structdevice_node*port;intr;+intret=0;if(parent=NULL)return0;
@@ -972,17 +973,20 @@ static int dss_init_ports(struct platform_device *pdev)switch(port_type){caseOMAP_DISPLAY_TYPE_DPI:-dpi_init_port(pdev,port);+ret=dpi_init_port(pdev,port);break;caseOMAP_DISPLAY_TYPE_SDI:-sdi_init_port(pdev,port);+ret=sdi_init_port(pdev,port);break;default:break;}}while((port=omapdss_of_get_next_port(parent,port))!=NULL);
What about the other issue raised by me?
Shouldn't initialization be stopped after first failure?
i.e.:
} while (!ret && (port = omapdss_of_get_next_port(parent, port)) != NULL);
Otherwise it is possible to return a success in case when
- initialization of the first port fails
- initialization of the second port is successful