From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795891136; b=gAei3Xiw6xcnVgW0fWe07gkupL6pYuOlM74hchbClroVPKJlntvzJriOVt+k9Ap6yvRV lmMcnzmJ++3LQIuqNfnhDTZeb097z/MU7w1gwHgHS7zFazuXDhODKn+Vr6/ls8BNNOQy/ +/5YOyLV93tiPCHQfKY8nFSsCojCnXfQOJbN+qeMqjqhtiSRPv1R28t9SPLobYwLt8ibd opwpM0MWky9e+JvuPo/+CMSOkRfZqNoMuiwjuixGpsWiqgAfbaDYoJO/KoVmkNRma4XJw pg2NtZ0gEPQqnyowj3P50tDuzjtcGp9mmBZYMaGCgyQaUABzeodm7g2IcskCD1UJvvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795891136; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=DwOOw4xYn2Uoheh0fl/Jkw69VqD/uMUi7PuANPAbVJU=; b=Hx98k5cB6f8nTOZcIReDH4b9hCB9bVQ08teI9pokUIXqfnudTs47Bf8M5C/1tlL+/RH3 lRcXB2kd4pBDN1aKFDfPslOPMjGyo0cfQYhFvNOFB0vUuAHTMCBDhD8RA6bchwNYS6dg+ EXd1FvprUEgq46iFkbEnoiw/HvoSDl+rrzm5z1hfdJQuSM51QtDHOupgM/HhnkMsQo3qV BZ4xW4rOeNAhYzIXQ6RpvmOOgbsL8mG+2aeqzMlecUqv4CSoAG9bdV6JA0yI6bbMXEObA bNJRi0+mGsi/tVmb/s+QD5q8m60Twcol9FMN+l1E2WYwjW8Iea4UAa1BOFaW4YUrToQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Zoan0ABY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08E69606A31C; Sat, 28 Nov 2026 18:38:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Zoan0ABY Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA9271F000C1; Sat, 28 Nov 2026 18:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795891135; bh=DwOOw4xYn2Uoheh0fl/Jkw69VqD/uMUi7PuANPAbVJU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Zoan0ABYm9yF52zdSKwwpjJqXgNVC5MMv4Ato6hXph8ueuYlzt9gJoLGwhdTh7dti 0Y7IpksJs1ah3HXTEtSix9F0VPz/9RE18qONWxi6fEzkvcxNO8DGiaYButrVcEe7J5 1F6YcEV4C/JEzf4a5H3VpRoOn0WtdS6WrMw2XA1s1xbLV1JaRCH38Mo8VnLy7xnj44 Z1Ol21ZTt+bPe7DfmL39crY0z5GtKMyL7poqaymaIw2bwfZwTtWBY0ag7Cv4Ttdkey D64of4L1cZdxm71BqANr69Y/N3d+xkPDkWHYA5qow75/AymWIjWAYQWnDroJKoeGmW uMKPrJAJQViKQ== Date: Sat, 28 Nov 2026 18:38:52 +0000 From: Jonathan Cameron To: Fabio Forni Cc: Fabio Forni via B4 Relay , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Johan Hovold , Peter Rosin , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , driver-core@lists.linux.dev, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH v2 1/2] drivers: core: platform: Add platform_get_match_data() helper Message-ID: <20261128183852.086c86fc@jic23-hlaptop> In-Reply-To: References: <20261128-iio_rescale_platform_ids-v2-0-4c35f16c4f77@redaril.me> <20261128-iio_rescale_platform_ids-v2-1-4c35f16c4f77@redaril.me> <20261128002732.7c47a16d@jic23-hlaptop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 28 Nov 2026 10:04:48 +0100 Fabio Forni wrote: > Hello Jonathan, > > On 28/11/26 01:27, Jonathan Cameron wrote: > > On Sat, 28 Nov 2026 00:22:09 +0100 > > Fabio Forni via B4 Relay wrote: > > > >> From: Fabio Forni > >> > >> device_get_match_data() retrieves driver data through the device's > >> fwnode. However, software nodes don't implement > >> fwnode->device_get_match_data(), so for a platform device that is > >> dynamically instantiated, device_get_match_data() is of no use. > >> platform_get_device_id() can be used instead, but this doesn't make the > >> driver code abstract enough. > >> > >> Add the platform_get_match_data() helper, so that driver data can be > >> retrieved from platform_device's fwnode *or* device_id as a fallback. > > I'd have added a reference to similar cases like i2c_get_match_data() > > or spi_get_device_match_data() > > Good idea, I'll do that in v3. I'll wait a few days to let others add comments. > > > and perhaps have followed the naming in there for the return variable. > > Both call it match. > > Alright. I think you want me to return NULL instead of -ENODATA as well? > The other helpers do so. I hadn't particularly noted that difference but yes, consistency on that would help reduce mistakes. Jonathan