Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942232AbcJ0N7g convert rfc822-to-8bit (ORCPT ); Thu, 27 Oct 2016 09:59:36 -0400 Received: from mail1.bemta5.messagelabs.com ([195.245.231.148]:33439 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941028AbcJ0N7c (ORCPT ); Thu, 27 Oct 2016 09:59:32 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNKsWRWlGSWpSXmKPExsUSt3Opse7hP4I RBl+fK1nMP3KO1eLwoheMFjc/fWO1uLxrDpvFjXX72C2eLDzDZNG69wi7xa0ZL1gdODx2zrrL 7nFts5jHplWdbB47vzewe3zeJBfAGsWamZeUX5HAmjFt32r2gs9cFYdnOTQwPuLoYuTiEBJYx igxa/Uhpi5GTg42AUOJeW/eM4LYIgJqEs2nWthAipgFVjNJ/JtwiA0kISzgJLH9wQZ2iCJnid PbV7FC2FYSUw7eBxrEwcEioCrxaXUKSJhXIEBi4/HVrBDLDjBKLH+8GqyeU8BI4kP7CTCbUUB W4kvjamYQm1lAXOLWk/lgB0kICEgs2XOeGcIWlXj5+B8rhC0vsfbXE6i4vcTre+9YIGx9iUeP HzFC2IYSq6YdgIqbS9w8sZwFYr6OxILdn9ggbG2JZQtfM0McKihxcuYTlgmM4rOQnDELScssJ C2zkLQsYGRZxahRnFpUllqka2Sul1SUmZ5RkpuYmaNraGCql5taXJyYnpqTmFSsl5yfu4kRGM n1DAyMOxivbvE7xCjJwaQkyvvwtmCEEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQneht9AOcGi1PT UirTMHGBKgUlLcPAoifBq/ARK8xYXJOYWZ6ZDpE4xKkqJ81aA9AmAJDJK8+DaYGnsEqOslDAv IwMDgxBPQWpRbmYJqvwrRnEORiVh3qMgU3gy80rgpr8CWswEtHh6ugDI4pJEhJRUA+PMhZXRc 5L/WcjFvk28sX1ZzKSu96fq321O3aMvd+6PztaKJU3zP81wddjH4sA/az6rm7lobPO05xunvc 1e1LlEleWPGcOZVfdkJ12zWmY4c8tmibMdzrHGDzfEePpr+6WzHJi2UW4+s9vZP3XrGTg1s9P vb0+zkLaWa2dab3W/Q/iSSleOSpESS3FGoqEWc1FxIgAXpPh/XgMAAA== X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-9.tower-178.messagelabs.com!1477573826!66865417!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked From: Steve Twiss To: Guenter Roeck CC: LINUX-KERNEL , LINUX-WATCHDOG , Wim Van Sebroeck , DEVICETREE , Dmitry Torokhov , LINUX-INPUT , "Rob Herring" Subject: RE: [PATCH V2 08/10] watchdog: da9062/61: watchdog driver Thread-Topic: [PATCH V2 08/10] watchdog: da9062/61: watchdog driver Thread-Index: AQHSL60d9p917Tk4Pk2E++bByg86HqC7BgYAgADvu0A= Date: Thu, 27 Oct 2016 13:10:24 +0000 Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7018CCE6655@SW-EX-MBX02.diasemi.com> References: <20161026185926.GA16142@roeck-us.net> In-Reply-To: <20161026185926.GA16142@roeck-us.net> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.26.77] x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-serverinfo: sw-ex-cashub02.diasemi.com, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 27/10/2016 05:19:00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1365 Lines: 47 On 26 October 2016 19:59 Guenter Roeck wrote: > On Wed, Oct 26, 2016 at 05:56:39PM +0100, Steve Twiss wrote: > > From: Steve Twiss > > > > +static const struct of_device_id da9062_compatible_id_table[] = { > > + { .compatible = "dlg,da9062-watchdog", .data = &da9062_watchdog_info }, > > + { }, > > +}; > > + > > static int da9062_wdt_probe(struct platform_device *pdev) > > { > > int ret; > > struct da9062 *chip; > > struct da9062_watchdog *wdt; > > + const struct of_device_id *match; > > > > chip = dev_get_drvdata(pdev->dev.parent); > > if (!chip) > > return -EINVAL; > > > > + match = of_match_node(da9062_compatible_id_table, > > + pdev->dev.of_node); > > + if (!match) > > + return -ENXIO; > > + > > wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); > > if (!wdt) > > return -ENOMEM; > > > > wdt->hw = chip; > > > > - wdt->wdtdev.info = &da9062_watchdog_info; > > + wdt->wdtdev.info = (const struct watchdog_info *)match->data; > > I don't see why you would need match->data or of_match_node above. Hi Guenter, True. I do not need to do any matching on the table any more if the assumption is to use a fall-back compatible string for DA9061 devices (to use the da9062 device driver). I can erase most of that content. Including the .data = &da9062_watchdog_info. Regards, Steve