Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1089154ybz; Fri, 17 Apr 2020 15:49:48 -0700 (PDT) X-Google-Smtp-Source: APiQypL5GHIE8WAiwES5FdbL4wSIYBthFQLD9RJWA3IIvO7Yv+yLF1JA/eCoQ0vHZG8yxD2VSb/H X-Received: by 2002:a17:906:6444:: with SMTP id l4mr5158594ejn.313.1587163788321; Fri, 17 Apr 2020 15:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587163788; cv=none; d=google.com; s=arc-20160816; b=FDvz4OTau3glBIZ4bA2NnWNy61hO3XohiAUUDMcreaQ8DiHWDZMhvAbwhtr8ME7Cfx JbTWSFe4CyAOoWlw1gbGzr1MN+cNJaAVvEvJWcRS/NYjeIkHCyh4BZCMvBVKiONM7mf7 KPd4j5ulBFLI6lf6KhvWX/KOYZyYahaLp6TU7W4ESNChHAn2IL5FEyJdXcnhNm3SNUm1 FiUPkxN5eUGm3mOV0l62CqCe/WZhE/CH8K+6YWWToyJZ7F+OW9YpoW+u8sXQdLnL6705 HC0vCOP0RSX+mORz3IHHHgf8Ow+1RiJnCsRdFmmkqZ3YbRuu6d+kMMRMPOugX8zWRXIf B4Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date :dkim-signature; bh=lnplkmtOlg6aQqRCemm0gncKeNcs1kJkULgCp1NFj8E=; b=s6n8fuoKKBSiVIFx5hFMPkYwWxe9xCG2e56ZTxDJGoceMk7AElBx03CGdTwpKGM8xI 3SSwCB2NZTCaxfpbSpGzZqpger2N0HM2XZg14a1fukPa2b+ti+578VXRw36O9yfa1rrF A5IFDE13tq/QpkFmg26p4Nw3g7ih55FmTo0EH3M04iNV3PiUriVgbohgp1CJ9UUDtxhO VOpGWFcHjFHdNcuQCsqm7pg2JvnbKMdMgv0vDkjytjDsLWc8cRP0P5MAtMYiYJiIJTTj NGE1QYahbswm0ZqvsWNxFjBbipqCKNLjyB5t1d83/0kIYynZp1Umdl1yFfzH7DjiziZD G6fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=KYbtDyHW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si14522129ejm.451.2020.04.17.15.49.25; Fri, 17 Apr 2020 15:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=KYbtDyHW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729028AbgDQWsX (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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