diff mbox

[net-next] net: davinci_mdio: fix building error without CONFIG_OF

Message ID 20180529115651.3420-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yue Haibing May 29, 2018, 11:56 a.m. UTC
gcc report a build error when compiling without CONFIG_OF
drivers/net/ethernet/ti/davinci_mdio.c: In function ‘davinci_mdio_probe’:
drivers/net/ethernet/ti/davinci_mdio.c:380:9: error: implicit declaration of function ‘davinci_mdio_probe_dt’ [-Werror=implicit-function-declaration]
   ret = davinci_mdio_probe_dt(&data->pdata, pdev);
         ^
Fixes: 9eae9c7d0875 ("drivers: net: davinci_mdio: enable pm runtime auto for ti cpsw-mdio")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/ti/davinci_mdio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Yue Haibing May 29, 2018, 1:34 p.m. UTC | #1
pls ignore this, there has been a Patch from Arnd Bergmann <arnd@arndb.de>

[PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF


On 2018/5/29 19:56, YueHaibing wrote:
> gcc report a build error when compiling without CONFIG_OF
> drivers/net/ethernet/ti/davinci_mdio.c: In function ‘davinci_mdio_probe’:
> drivers/net/ethernet/ti/davinci_mdio.c:380:9: error: implicit declaration of function ‘davinci_mdio_probe_dt’ [-Werror=implicit-function-declaration]
>    ret = davinci_mdio_probe_dt(&data->pdata, pdev);
>          ^
> Fixes: 9eae9c7d0875 ("drivers: net: davinci_mdio: enable pm runtime auto for ti cpsw-mdio")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/ethernet/ti/davinci_mdio.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
> index 8ac7283..6e544d9 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
> @@ -339,9 +339,7 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
>  
>  	return 0;
>  }
> -#endif
>  
> -#if IS_ENABLED(CONFIG_OF)
>  static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
>  	.autosuspend_delay_ms = 100,
>  };
> @@ -352,6 +350,12 @@ static const struct of_device_id davinci_mdio_of_mtable[] = {
>  	{ /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable);
> +#else
> +static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
> +				 struct platform_device *pdev)
> +{
> +	return -EINVAL;
> +}
>  #endif
>  
>  static int davinci_mdio_probe(struct platform_device *pdev)
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 8ac7283..6e544d9 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -339,9 +339,7 @@  static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
 
 	return 0;
 }
-#endif
 
-#if IS_ENABLED(CONFIG_OF)
 static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
 	.autosuspend_delay_ms = 100,
 };
@@ -352,6 +350,12 @@  static const struct of_device_id davinci_mdio_of_mtable[] = {
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable);
+#else
+static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
+				 struct platform_device *pdev)
+{
+	return -EINVAL;
+}
 #endif
 
 static int davinci_mdio_probe(struct platform_device *pdev)