From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755197AbbCEKs5 (ORCPT ); Thu, 5 Mar 2015 05:48:57 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:37065 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755134AbbCEKsy (ORCPT ); Thu, 5 Mar 2015 05:48:54 -0500 Message-ID: <54F83492.5080103@ti.com> Date: Thu, 5 Mar 2015 12:48:50 +0200 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Axel Lin , Kishon Vijay Abraham I CC: Vignesh R , Felipe Balbi , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr References: <1425550725.21331.1.camel@phoenix> In-Reply-To: <1425550725.21331.1.camel@phoenix> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 05/03/15 12:18, Axel Lin wrote: > if !CONFIG_OF, the probe fails. > This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are > not needed. > > Signed-off-by: Axel Lin > --- > drivers/phy/phy-omap-control.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c > index efe724f..a7653d9 100644 > --- a/drivers/phy/phy-omap-control.c > +++ b/drivers/phy/phy-omap-control.c > @@ -216,7 +216,6 @@ void omap_control_usb_set_mode(struct device *dev, > return; > > ctrl_phy = dev_get_drvdata(dev); > - > if (!ctrl_phy) { > dev_err(dev, "Invalid control phy device\n"); > return; > @@ -241,8 +240,6 @@ void omap_control_usb_set_mode(struct device *dev, > } > EXPORT_SYMBOL_GPL(omap_control_usb_set_mode); > > -#ifdef CONFIG_OF > - > static const enum omap_control_phy_type otghs_data = OMAP_CTRL_TYPE_OTGHS; > static const enum omap_control_phy_type usb2_data = OMAP_CTRL_TYPE_USB2; > static const enum omap_control_phy_type pipe3_data = OMAP_CTRL_TYPE_PIPE3; > @@ -278,8 +275,6 @@ static const struct of_device_id omap_control_phy_id_table[] = { > {}, > }; > MODULE_DEVICE_TABLE(of, omap_control_phy_id_table); > -#endif > - Since we're anyways going to fail probe for !CONFIG_OF, why do you want to add the unnecessary device table to the kernel? what are you benefiting from this change? > > static int omap_control_phy_probe(struct platform_device *pdev) > { > @@ -287,8 +282,7 @@ static int omap_control_phy_probe(struct platform_device *pdev) > const struct of_device_id *of_id; > struct omap_control_phy *control_phy; > > - of_id = of_match_device(of_match_ptr(omap_control_phy_id_table), > - &pdev->dev); > + of_id = of_match_device(omap_control_phy_id_table, &pdev->dev); > if (!of_id) > return -EINVAL; > > @@ -344,7 +338,7 @@ static struct platform_driver omap_control_phy_driver = { > .probe = omap_control_phy_probe, > .driver = { > .name = "omap-control-phy", > - .of_match_table = of_match_ptr(omap_control_phy_id_table), > + .of_match_table = omap_control_phy_id_table, > }, > }; > > cheers, -roger