Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1748261ybg; Sat, 19 Oct 2019 01:39:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5Ln0hmAdI04aFU4hTXfX2KFE1xpKHGUidTLhuEtRFoaAPFiiT3IK/5Vsw1yj7ogZPCvlf X-Received: by 2002:a05:6402:2d2:: with SMTP id b18mr14020285edx.264.1571474349751; Sat, 19 Oct 2019 01:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571474349; cv=none; d=google.com; s=arc-20160816; b=D63BWdIVWCk9UZ7qGaCng08Vf9fG/igu4S5v/oNzlEhWMtgRfycjwJGdcRfkdnsbE/ Y3/Qzs8P193NuAqJqgsOvodZUwl0D5QCg5AjrJysp3OoI82fXUWoKt8ZjAJo0WQNL5mG uu4pS1zx45U0C1yzF9FrLgqd82bvprZOjSW17+oHJzzMJ4RQTEnjiByns01coO51nguG +blzLLP+U60RvPnmrGwXPTzMF8i3W5zTM13iEsaw2zptmXE2N48tFctD95d0N8mQz/EP d9DkpTHuPo82RVN4QzzcOmxX2NycwK7CUZlDfV793YiDM+xlyCBagTmjqQwkBMhb+FTc FHtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oHAE10EktnPOoE/+c84l9YTUjXRghji4T7W4SFCNp1E=; b=hFwNf/WQ7PmdQmDlRAruB0Qt5/cGMv/C6zD164m5ifhzwzmYhQBXXEhuY7E15AEXVU ZxQVfCQaypzTyqiJxaRt91y9crdvStV3r9RvUjQfdzSdmKDPuodzDzwqNwwM89W++uod fY/2h/dgkR6ldJo/LqyyD9PXWBeXw1qJre+RPUXzSM0YB6SxUpeor1XII+pm28o8sP2z yWRUxb2/nHcyg+Y1Bx5OBocMDSGA0/xFf963a/pn2nNWvU7hCHjiG4Dn22AUi6iW9sfi i/I8wIL541y4WO1kUdoPY4Uu3BUrUiZDy52PUHEUdDjG9Rs4fBEUL4kqlRsoyOKMHGkB mkKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SpHNFF6A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si4698588ejz.394.2019.10.19.01.38.46; Sat, 19 Oct 2019 01:39:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SpHNFF6A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394305AbfJRQGm (ORCPT + 99 others); Fri, 18 Oct 2019 12:06:42 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52358 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727834AbfJRQGm (ORCPT ); Fri, 18 Oct 2019 12:06:42 -0400 Received: by mail-wm1-f65.google.com with SMTP id r19so6758026wmh.2 for ; Fri, 18 Oct 2019 09:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oHAE10EktnPOoE/+c84l9YTUjXRghji4T7W4SFCNp1E=; b=SpHNFF6AuB9nbvorwHz1NPDQGPyA5QEAi+SaVBWB/ZEM8nCNIUC1b1kw74uVYZPj1r RAeHyDYh19zzMHflkvWMWRIuJ5slQapPu10XslSLSqVtsthQGRCuIzORgk2DamDFgRnP huXopPO79qkWyBvwCGydLsRA6xfRxfqb7nmAWw1zbD4yv8jmu9zLQB8kOT/BRmL6x63y vxGi8st5rytavEcUBYR+Ylp2TRzLFTUwti9KR10q+YLbbSunzKNTsnt0ePUR4QTdjdIE iAJXNjHqgF8qhL1/ESTCDoOfWodoWGxV9FIe7LG9jBkWq05mN58EJCVlSFTWUq5wrnAo gpjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oHAE10EktnPOoE/+c84l9YTUjXRghji4T7W4SFCNp1E=; b=fdcCx8SWLSYQeNQM2lRFmSVOS5cC1gkqVU+ZRkzVQvXLaMF/aUgyYwtJpw+9ET68PZ HblvoPwfh6xZWm/d3PqsFwoJVxxsXZjVlJqnGNn5tJhksaS0wtkWIFzxQJBSDocgjlvk GB1mQKIaUAANHPB+QJFODA6fjyB9+vVr32nRhV/sKN9cVLcq5ZSU7Htio8xiB+dOPpma wXbOepKq5IPifhaWun5ltb7DmN/+1jW78emjYHS+EtlU0wIdfN8LsK8yOyqFoeN7SglB KDYBN23AWCVhws8jHYrFA/N1CNWHTD7WdKzFs+AoBT40NvzZhS5mUTEGHGUa6HB/xffI R8ug== X-Gm-Message-State: APjAAAX0j4e0LenhdFASEO6mXy2BIbl0qFOpELeom9KCAzdFpfeH7Iz2 GdQpAVCot37JbRYIs7QG12GDSg== X-Received: by 2002:a1c:7418:: with SMTP id p24mr7895964wmc.132.1571414799007; Fri, 18 Oct 2019 09:06:39 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id s9sm6622703wme.36.2019.10.18.09.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 09:06:37 -0700 (PDT) Date: Fri, 18 Oct 2019 17:06:36 +0100 From: Daniel Thompson To: Lee Jones Cc: broonie@kernel.org, linus.walleij@linaro.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dilinger@queued.net Subject: Re: [PATCH 3/4] mfd: cs5535-mfd: Register clients using their own dedicated MFD cell entries Message-ID: <20191018160636.pt4im3m3hlruobms@holly.lan> References: <20191018125608.5362-1-lee.jones@linaro.org> <20191018125608.5362-4-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018125608.5362-4-lee.jones@linaro.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 01:56:07PM +0100, Lee Jones wrote: > CS5535 is the only user of mfd_clone_cell(). It makes more sense to > register child devices in the traditional way and remove the quite > bespoke mfd_clone_cell() call from the MFD API. Like the other thread... this looks like it takes a shared (cloned) reference counter and creates two independant ones instead. Daniel. > > Signed-off-by: Lee Jones > --- > drivers/mfd/cs5535-mfd.c | 34 +++++++++++++++++++++++++++++----- > 1 file changed, 29 insertions(+), 5 deletions(-) > > diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c > index b01e5bb4ed03..2711e6e42742 100644 > --- a/drivers/mfd/cs5535-mfd.c > +++ b/drivers/mfd/cs5535-mfd.c > @@ -95,9 +95,23 @@ static struct mfd_cell cs5535_mfd_cells[] = { > }, > }; > > -static const char *olpc_acpi_clones[] = { > - "olpc-xo1-pm-acpi", > - "olpc-xo1-sci-acpi" > +static struct mfd_cell cs5535_olpc_mfd_cells[] = { > + { > + .name = "olpc-xo1-pm-acpi", > + .num_resources = 1, > + .resources = &cs5535_mfd_resources[ACPI_BAR], > + > + .enable = cs5535_mfd_res_enable, > + .disable = cs5535_mfd_res_disable, > + }, > + { > + .name = "olpc-xo1-sci-acpi", > + .num_resources = 1, > + .resources = &cs5535_mfd_resources[ACPI_BAR], > + > + .enable = cs5535_mfd_res_enable, > + .disable = cs5535_mfd_res_disable, > + }, > }; > > static int cs5535_mfd_probe(struct pci_dev *pdev, > @@ -130,8 +144,18 @@ static int cs5535_mfd_probe(struct pci_dev *pdev, > goto err_disable; > } > > - if (machine_is_olpc()) > - mfd_clone_cell("cs5535-acpi", olpc_acpi_clones, ARRAY_SIZE(olpc_acpi_clones)); > + if (machine_is_olpc()) { > + err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, > + cs5535_olpc_mfd_cells, > + ARRAY_SIZE(cs5535_olpc_mfd_cells), > + NULL, 0, NULL); > + if (err) { > + dev_err(&pdev->dev, > + "Failed to add CS5532 OLPC sub-devices: %d\n", > + err); > + goto err_disable; > + } > + } > > dev_info(&pdev->dev, "%zu devices registered.\n", > ARRAY_SIZE(cs5535_mfd_cells)); > -- > 2.17.1 >