From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 3/5] mfd: tc3589x: reform device tree probing Date: Wed, 16 Oct 2013 10:43:56 +0100 Message-ID: <20131016094356.GE19112@lee--X1> References: <1381871803-22796-1-git-send-email-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1381871803-22796-1-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linus Walleij Cc: Samuel Ortiz , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, 15 Oct 2013, Linus Walleij wrote: > This changes the following mechanisms in the TC3589x device tree > probing path: >=20 > - Use the .of_match_table in struct device_driver to match the > device in the device tree. > - Add matches for the proper compatible strings "toshiba,..." > and all sub-variants, just as is done for the .id matches. > - Move over all the allocation of platform data etc to the > tc3589x_of_probe() function and follow the pattern of passing > a platform data pointer back, or an error pointer on error, > as found in the STMPE driver. > - Match the new (proper) compatible strings for the GPIO and > keypad MFD cells. > - Use of_device_is_compatible() rather than just !strcmp() > to discover which cells to instantiate. >=20 > Signed-off-by: Linus Walleij > --- > drivers/mfd/tc3589x.c | 84 ++++++++++++++++++++++++++++++++++++-----= ---------- > 1 file changed, 59 insertions(+), 25 deletions(-) Nice patch overall. > + of_id =3D of_match_device(tc3589x_match, dev); > + if (!of_id) > + return ERR_PTR(-ENODEV); I still think -EINVAL is better in this case, but I see that some people are using -ENODEV as well and I'm not religious enough about it to care, so: Acked-by: Lee Jones :) --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760379Ab3JPJoD (ORCPT ); Wed, 16 Oct 2013 05:44:03 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:48262 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760112Ab3JPJoA (ORCPT ); Wed, 16 Oct 2013 05:44:00 -0400 Date: Wed, 16 Oct 2013 10:43:56 +0100 From: Lee Jones To: Linus Walleij Cc: Samuel Ortiz , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] mfd: tc3589x: reform device tree probing Message-ID: <20131016094356.GE19112@lee--X1> References: <1381871803-22796-1-git-send-email-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1381871803-22796-1-git-send-email-linus.walleij@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Oct 2013, Linus Walleij wrote: > This changes the following mechanisms in the TC3589x device tree > probing path: > > - Use the .of_match_table in struct device_driver to match the > device in the device tree. > - Add matches for the proper compatible strings "toshiba,..." > and all sub-variants, just as is done for the .id matches. > - Move over all the allocation of platform data etc to the > tc3589x_of_probe() function and follow the pattern of passing > a platform data pointer back, or an error pointer on error, > as found in the STMPE driver. > - Match the new (proper) compatible strings for the GPIO and > keypad MFD cells. > - Use of_device_is_compatible() rather than just !strcmp() > to discover which cells to instantiate. > > Signed-off-by: Linus Walleij > --- > drivers/mfd/tc3589x.c | 84 ++++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 59 insertions(+), 25 deletions(-) Nice patch overall. > + of_id = of_match_device(tc3589x_match, dev); > + if (!of_id) > + return ERR_PTR(-ENODEV); I still think -EINVAL is better in this case, but I see that some people are using -ENODEV as well and I'm not religious enough about it to care, so: Acked-by: Lee Jones :) -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog