From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9775C38A2B for ; Fri, 17 Apr 2020 22:48:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C74C82223C for ; Fri, 17 Apr 2020 22:48:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="KYbtDyHW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728482AbgDQWsX (ORCPT ); Fri, 17 Apr 2020 18:48:23 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:45918 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbgDQWsX (ORCPT ); Fri, 17 Apr 2020 18:48:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1587163700; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lnplkmtOlg6aQqRCemm0gncKeNcs1kJkULgCp1NFj8E=; b=KYbtDyHW2xDF6OLyMVpHR10Oag/ONw+OglyvIRFt/kuSblQQMcP2nlwdF6bkil3V0JDzLX ESBoxn9n5e/VmVDypGgtv244VnvAgS5G3LCDC/Lh1yOL76sviZpFuRfBB1MnlYvocjwVYC /cErR2JFf+OjWI9xIBlN+ZVlnOQ5DS4= Date: Sat, 18 Apr 2020 00:48:07 +0200 From: Paul Cercueil Subject: Re: [RESEND PATCH v5 5/5] input: joystick: Add ADC attached joystick driver. To: Andy Shevchenko Cc: Artur Rojek , Dmitry Torokhov , Rob Herring , Mark Rutland , Jonathan Cameron , Heiko Stuebner , linux-input , devicetree , linux-iio , Linux Kernel Mailing List Message-Id: <7CFY8Q.68YMS0V08F992@crapouillou.net> In-Reply-To: References: <20200417202859.35427-1-contact@artur-rojek.eu> <20200417202859.35427-5-contact@artur-rojek.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Le sam. 18 avril 2020 =E0 0:49, Andy Shevchenko=20 a =E9crit : > On Sat, Apr 18, 2020 at 12:24 AM Paul Cercueil =20 > wrote: >> Le sam. 18 avril 2020 =E0 0:10, Andy Shevchenko >> a =E9crit : >> > On Fri, Apr 17, 2020 at 11:21 PM Artur Rojek=20 >> >> > wrote: >=20 > ... >=20 >> >> +#include >> > >> > Do you really need this? (See below as well) >=20 >> >> +static const struct of_device_id adc_joystick_of_match[] =3D { >> >> + { .compatible =3D "adc-joystick", }, >> >> + { }, >> >> +}; >> >> +MODULE_DEVICE_TABLE(of, adc_joystick_of_match); >> >> + >> >> +static struct platform_driver adc_joystick_driver =3D { >> >> + .driver =3D { >> >> + .name =3D "adc-joystick", >> > >> >> + .of_match_table =3D >> >> of_match_ptr(adc_joystick_of_match), >> > >> > Drop this a bit harmful of_match_ptr() macro. It should go with=20 >> ugly >> > #ifdeffery. Here you simple introduced a compiler warning. >>=20 >> I assume you mean #ifdef around the of_device_id + module table=20 >> macro? >=20 > Yes. >=20 >> > On top of that, you are using device property API, OF use in this=20 >> case >> > is contradictory (at lest to some extend). >>=20 >> I don't see why. The fact that the driver can work when probed from >> platform code >=20 > Ha-ha, tell me how. I would like to be very surprised. iio_map_array_register(), pinctrl_register_mappings(), platform_add_devices(), you're welcome. >> doesn't mean that it shouldn't have a table to probe >> from devicetree. >=20 > I didn't get what you are talking about here. The idea of _unified_ > device property API is to get rid of OF-centric code in favour of more > generic approach. Mixing those two can be done only in specific cases > (here is not the one). And how are we mixing those two here? The only OF-centric thing here is=20 the device table, which is required if we want the driver to probe from=20 devicetree. -Paul >=20 > -- > With Best Regards, > Andy Shevchenko