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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 B6881C0018C for ; Sun, 13 Dec 2020 19:52:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80A86239ED for ; Sun, 13 Dec 2020 19:52:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732519AbgLMTwP (ORCPT ); Sun, 13 Dec 2020 14:52:15 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:59121 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725308AbgLMTwM (ORCPT ); Sun, 13 Dec 2020 14:52:12 -0500 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 23558200002; Sun, 13 Dec 2020 19:51:30 +0000 (UTC) Date: Sun, 13 Dec 2020 20:51:29 +0100 From: Alexandre Belloni To: Jonathan Cameron Cc: Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] iio:pressure:ms5637: introduce hardware differentiation Message-ID: <20201213195129.GN1781038@piout.net> References: <20201209234857.1521453-1-alexandre.belloni@bootlin.com> <20201209234857.1521453-3-alexandre.belloni@bootlin.com> <20201213171237.4dfe58f5@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201213171237.4dfe58f5@archlinux> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/2020 17:12:37+0000, Jonathan Cameron wrote: > > static const int ms5637_samp_freq[6] = { 960, 480, 240, 120, 60, 30 }; > > /* String copy of the above const for readability purpose */ > > static const char ms5637_show_samp_freq[] = "960 480 240 120 60 30"; > > @@ -128,6 +133,7 @@ static const struct iio_info ms5637_info = { > > > > static int ms5637_probe(struct i2c_client *client) > > { > > + const struct ms_tp_data *data = device_get_match_data(&client->dev); > > As a follow up to the earlier fun with greybus etc, have to jump through > some hoops to have a fallback here if we have a firmware type that can't > do get_match_data driver/base/sw_node.c is the one greybus is using. > > We have drivers that don't do this because frankly I didn't know about it > until a month or two ago. However, I'm not keen to introduce any > more. > Couldn't greybus be fixed in that regard? Using the i2c_device_id has been deprecated for a while now. what we could do is only provide ms5803 support when there is an of_node. So this doesn't break the ABI and doesn't break greybus and at the same time doesn't unnecessarily add complexity to the probe for something that will probably never be used. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com 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=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 C2200C433FE for ; Sun, 13 Dec 2020 19:53:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81C59239ED for ; Sun, 13 Dec 2020 19:53:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81C59239ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Gzfrf5yHFYz1X6x3d0jhbVKGbgqZU/RH6gXOYgDjDyc=; b=qrVEycmbvd/EsugMZi8h2yvv5 xZaPLwDNqsgs1cM3ojbCE6VSTZrRFBIdWELJzP7vhzJsl1aEC/2dMSlXxLsZjIBrU9jK7lzJk9xBD SJhGgq38WDS6Z4y8fbW7lILH/woScYBpytk3dTzFap7n+XAOgJx6+uFm/qbsn+bjLOQzLMa0nRNdi zMCr/Mb8Np7wrPs0XgaiCMUf3LumNu+NgwwMyeOJX+m34igufmwgvBJ1UK8vcOWycceJrgmlg0ovm 6g7oLIwLE7yp2dX2YLVC4h5k35x21tzvg8muUWvo2kD1Tat5YUJMSEnVGRSNXIH2HEx+ViclDLIGE Mt4WGox+Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1koXP5-0007dT-Kc; Sun, 13 Dec 2020 19:51:35 +0000 Received: from relay12.mail.gandi.net ([217.70.178.232]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1koXP2-0007d9-Bf for linux-arm-kernel@lists.infradead.org; Sun, 13 Dec 2020 19:51:33 +0000 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 23558200002; Sun, 13 Dec 2020 19:51:30 +0000 (UTC) Date: Sun, 13 Dec 2020 20:51:29 +0100 From: Alexandre Belloni To: Jonathan Cameron Subject: Re: [PATCH 2/6] iio:pressure:ms5637: introduce hardware differentiation Message-ID: <20201213195129.GN1781038@piout.net> References: <20201209234857.1521453-1-alexandre.belloni@bootlin.com> <20201209234857.1521453-3-alexandre.belloni@bootlin.com> <20201213171237.4dfe58f5@archlinux> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201213171237.4dfe58f5@archlinux> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201213_145132_516683_12CD6818 X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 13/12/2020 17:12:37+0000, Jonathan Cameron wrote: > > static const int ms5637_samp_freq[6] = { 960, 480, 240, 120, 60, 30 }; > > /* String copy of the above const for readability purpose */ > > static const char ms5637_show_samp_freq[] = "960 480 240 120 60 30"; > > @@ -128,6 +133,7 @@ static const struct iio_info ms5637_info = { > > > > static int ms5637_probe(struct i2c_client *client) > > { > > + const struct ms_tp_data *data = device_get_match_data(&client->dev); > > As a follow up to the earlier fun with greybus etc, have to jump through > some hoops to have a fallback here if we have a firmware type that can't > do get_match_data driver/base/sw_node.c is the one greybus is using. > > We have drivers that don't do this because frankly I didn't know about it > until a month or two ago. However, I'm not keen to introduce any > more. > Couldn't greybus be fixed in that regard? Using the i2c_device_id has been deprecated for a while now. what we could do is only provide ms5803 support when there is an of_node. So this doesn't break the ABI and doesn't break greybus and at the same time doesn't unnecessarily add complexity to the probe for something that will probably never be used. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel