Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753574AbbFXPby (ORCPT ); Wed, 24 Jun 2015 11:31:54 -0400 Received: from mail-qc0-f181.google.com ([209.85.216.181]:32951 "EHLO mail-qc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753255AbbFXPbx (ORCPT ); Wed, 24 Jun 2015 11:31:53 -0400 Message-ID: <558ACD67.9050704@hurleysoftware.com> Date: Wed, 24 Jun 2015 11:31:51 -0400 From: Peter Hurley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: =?UTF-8?B?SsO8cmcgQmlsbGV0ZXI=?= , Greg Kroah-Hartman CC: Gigi Joseph , Colin Ian King , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] ti-st: st_kim: fix nshutdown_gpio in get_platform_data References: <1435141446-27236-1-git-send-email-j@bitron.ch> <1435141446-27236-2-git-send-email-j@bitron.ch> In-Reply-To: <1435141446-27236-2-git-send-email-j@bitron.ch> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1933 Lines: 60 On 06/24/2015 06:24 AM, Jürg Billeter wrote: > Use of_get_named_gpio instead of of_property_read_u32. > > Signed-off-by: Jürg Billeter > --- > drivers/misc/ti-st/st_kim.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c > index af71584..8df8faa 100644 > --- a/drivers/misc/ti-st/st_kim.c > +++ b/drivers/misc/ti-st/st_kim.c > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > > #define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */ > static struct platform_device *st_kim_devices[MAX_ST_DEVICES]; > @@ -749,7 +750,7 @@ static struct ti_st_plat_data *get_platform_data(struct device *dev) > { > struct device_node *np = dev->of_node; > const u32 *dt_property; > - int len; > + int len, gpio; > > dt_pdata = kzalloc(sizeof(*dt_pdata), GFP_KERNEL); > > @@ -761,8 +762,14 @@ static struct ti_st_plat_data *get_platform_data(struct device *dev) > dt_property = of_get_property(np, "dev_name", &len); > if (dt_property) > memcpy(&dt_pdata->dev_name, dt_property, len); > - of_property_read_u32(np, "nshutdown_gpio", > - &dt_pdata->nshutdown_gpio); > + > + gpio = of_get_named_gpio(np, "nshutdown_gpio", 0); NAK. This breaks existing dtbs, since the format is not the same. Regards, Peter Hurley > + if (gpio < 0) { > + kfree(dt_pdata); > + return ERR_PTR(gpio); > + } > + dt_pdata->nshutdown_gpio = gpio; > + > of_property_read_u32(np, "flow_cntrl", &dt_pdata->flow_cntrl); > of_property_read_u32(np, "baud_rate", &dt_pdata->baud_rate); > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/