lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 25 Jul 2013 22:00:23 +0300
From:	Felipe Balbi <balbi@...com>
To:	Tuomas Tynkkynen <ttynkkynen@...dia.com>
CC:	<balbi@...com>, <linux-tegra@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>,
	<swarren@...dotorg.org>, <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v3 8/9] usb: phy: tegra: Use DT helpers for phy_type

Hi,

On Thu, Jul 25, 2013 at 09:38:08PM +0300, Tuomas Tynkkynen wrote:
> Use the new of_usb_get_phy_mode helper function for parsing phy_type
> from the device tree.
> 
> Signed-off-by: Tuomas Tynkkynen <ttynkkynen@...dia.com>
> Reviewed-by: Stephen Warren <swarren@...dia.com>
> Tested-by: Stephen Warren <swarren@...dia.com>
> ---
>  drivers/usb/phy/phy-tegra-usb.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
> index fb5bc8c..fb469f1 100644
> --- a/drivers/usb/phy/phy-tegra-usb.c
> +++ b/drivers/usb/phy/phy-tegra-usb.c
> @@ -31,6 +31,7 @@
>  #include <linux/of_gpio.h>
>  #include <linux/usb/otg.h>
>  #include <linux/usb/ulpi.h>
> +#include <linux/usb/of.h>
>  #include <asm/mach-types.h>
>  #include <linux/usb/ehci_def.h>
>  #include <linux/usb/tegra_usb_phy.h>
> @@ -860,6 +861,7 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	struct tegra_usb_phy *tegra_phy = NULL;
>  	struct device_node *np = pdev->dev.of_node;
> +	enum usb_phy_interface phy_type;
>  	int err;
>  
>  	tegra_phy = devm_kzalloc(&pdev->dev, sizeof(*tegra_phy), GFP_KERNEL);
> @@ -884,12 +886,12 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
>  	tegra_phy->is_legacy_phy =
>  		of_property_read_bool(np, "nvidia,has-legacy-mode");
>  
> -	err = of_property_match_string(np, "phy_type", "ulpi");
> -	if (err < 0) {
> +	phy_type = of_usb_get_phy_mode(np);
> +	if (phy_type == USBPHY_INTERFACE_MODE_UTMI) {

can you add one more patch to your series converting this to a switch ?
I can apply this one as is, but this really looks like a good fit for a
switch statement

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ