Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp475417rdh; Tue, 19 Dec 2023 04:56:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5N5Mbalg6S0pyYVlrHXjd/x25R7l2/PXpfY7pP0M4y3+3e7xmW8TdCqko/hUHUvf4M7Hl X-Received: by 2002:ac8:5c01:0:b0:41e:39c8:97c7 with SMTP id i1-20020ac85c01000000b0041e39c897c7mr24988945qti.41.1702990574207; Tue, 19 Dec 2023 04:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702990574; cv=none; d=google.com; s=arc-20160816; b=frvb20VtetUp03k8yZIWjHweCSDzf4XN9rO8LVki/bxeAnl5CQz57791rGLUkNmYnX Sr2/HbSgGTlAA933aDqHjb8FcnX+REaJmZx9OkVL7EVh0PFhiJQqdRT0nod+v6PxXIEb VoSPP0rZeVxAilwgGrlMRI+yWnUhx46+3jae4Ni65Bqa2n7aNXzntibK2cjPTabGpyhW REt3Y16yCFtBndSJjV7XG2DO/nlQcPA5p8IWnrEeh6WBNuL+SLqGW1rbXzxZ6Mt3X+bA LACf/8o8H1Vy2/90+1rmo0cLpSuJ9LgyXdp8svd4dlnmtlzE5clQsRBC8KO56deJ+bcj NKAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=eZ4FFwu75FPNZaoEBUmiGs2Cfmi6sxpqh1/xjHDIrSs=; fh=R+XHeJV11UNUPnckx7rWezlQul7eB6Tra6R/bN4x1RQ=; b=Y0VQLgxtlFundkd5ds+E2q0mOjPHB6OgOTBgvtDNgm4SNdENen4wQO3i1cfDjlxZzA PAd1FEQ3h8STX7sPro3t9Xg4Oq0aglxE39UE0mcOP2Ns5SyVepsayKnlWb4tBiSrGaJ0 9QzyS0J15ecnXf998W21BMWn2Pf5hcVZ6M8Cy9FOB5D/npYgJiFQAasAvBw9CAeBtYtX OgnpsjqGaTX6oFsz+KjPu7ER85vXwS/z6uSWC6QRBp2t+gwVuxtXklN8SN0Bs4uVj1xG yE7yzuCmURJI8r3LjBxv3zcUoYzW6jvWwMMthaZU+8yceB1b3JGnLZr6FJoBEmUtiIGr 7Rrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QKCcZVXa; spf=pass (google.com: domain of linux-kernel+bounces-5217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m2-20020a05622a118200b0042578f1a3edsi26650745qtk.710.2023.12.19.04.56.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 04:56:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QKCcZVXa; spf=pass (google.com: domain of linux-kernel+bounces-5217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EE96F1C23CB4 for ; Tue, 19 Dec 2023 12:56:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7845F18C21; Tue, 19 Dec 2023 12:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QKCcZVXa" X-Original-To: linux-kernel@vger.kernel.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C792918B04 for ; Tue, 19 Dec 2023 12:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 3D9CA1C000E; Tue, 19 Dec 2023 12:55:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702990557; h=from:from: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=eZ4FFwu75FPNZaoEBUmiGs2Cfmi6sxpqh1/xjHDIrSs=; b=QKCcZVXaHhki+uoPYuWE2TI2e3//UYWwasRttEklWVrTsJsfjzy/T/V7J5Hhh7iFJXzbQk G+9HgVNzCTtJzyfAQLYukrL4XalJ+Q8j94CAuzKCzonv6Ow0Kh5pXRktmO4npeLAdExtLr Cg2URAKPN/eu5hsEOwnsORRLt1NsKnpYJyhCszHbFlC99WSKerbssnzird70zwhJ6E1HOp byzJgUnEI+PtE+kSAYH+zeUJccQZksPbJF+tYPgYP6vhQpBtAccGaj/U1aAYk7kM6WtjQ1 MTXbmAD29boQ34Sd0gOcpT1xfqu2wTIspoGTCXRrA41B+peaEkAfO4ZYily3Qg== Date: Tue, 19 Dec 2023 13:55:53 +0100 From: Miquel Raynal To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Michael Walle , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH v6.8 1/2] nvmem: layouts: refactor .add_cells() callback arguments Message-ID: <20231219135553.4e1b74f4@xps-13> In-Reply-To: <20231219120104.3422-1-zajec5@gmail.com> References: <20231219120104.3422-1-zajec5@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi Rafa=C5=82, zajec5@gmail.com wrote on Tue, 19 Dec 2023 13:01:03 +0100: > From: Rafa=C5=82 Mi=C5=82ecki >=20 > Simply pass whole "struct nvmem_layout" instead of single variables. > There is nothing in "struct nvmem_layout" that we have to hide from > layout drivers. They also access it during .probe() and .remove(). >=20 > Thanks to this change: >=20 > 1. API gets more consistent > All layouts drivers callbacks get the same argument >=20 > 2. Layouts get correct device > Before this change NVMEM core code was passing NVMEM device instead > of layout device. That resulted in: > * Confusing prints > * Calling devm_*() helpers on wrong device > * Helpers like of_device_get_match_data() dereferencing NULLs >=20 > 3. It gets possible to get match data > First of all nvmem_layout_get_match_data() requires passing "struct > nvmem_layout" which .add_cells() callback didn't have before this. It > doesn't matter much as it's rather useless now anyway (and will be > dropped). > What's more important however is that of_device_get_match_data() can > be used now thanks to owning a proper device pointer. >=20 > Signed-off-by: Rafa=C5=82 Mi=C5=82ecki Reviewed-by: Miquel Raynal Thanks, Miqu=C3=A8l