From mboxrd@z Thu Jan 1 00:00:00 1970 From: kishon Subject: Re: [PATCH,RFC] usb: add devicetree helpers for determining dr_mode and phy_type Date: Tue, 29 Jan 2013 19:40:23 +0530 Message-ID: <5107D84F.80401@ti.com> References: <1359458548-25071-1-git-send-email-s.hauer@pengutronix.de> <5107D253.5030400@ti.com> <20130129135336.GA3323@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130129135336.GA3323-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Wolfram Sang Cc: Michael Grzeschik , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, Marc Kleine-Budde , kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, Sascha Hauer , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Tuesday 29 January 2013 07:23 PM, Wolfram Sang wrote: >>> + err = of_property_read_string(np, "phy_type", &phy_type); >>> + if (err < 0) >>> + return USBPHY_INTERFACE_MODE_NA; >> >> Why don't we use a u32 property type for the *phy-type*? IMHO we >> should use string property only when the property should be >> absolutely unambiguous (e.g., compatible property should be string). > > If we would use u32-numbers in the compatible entry, this would also be > unambiguous, no? 0xd00dfeed would be the at24-driver. Pretty specific. hehe... But we don't have a corresponding *enum* representing the drivers :-) > > I don't mind having readable devicetrees. And we have it for ethernet > phys already with strings, so it would be consistent. Ok. Fine with it then :-) Thanks Kishon