From patchwork Fri Nov 1 07:45:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178252 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp116799ill; Fri, 1 Nov 2019 00:45:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi65SG0dRuU8FOm4j6odv0QdN6cqrizKlIpqFRqGv2iMolgQ9MH2qL1NY0LhA2uhr3gdva X-Received: by 2002:a17:906:557:: with SMTP id k23mr8126820eja.165.1572594337734; Fri, 01 Nov 2019 00:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572594337; cv=none; d=google.com; s=arc-20160816; b=N7R3hzWRL/YQMsadn1tfK24nALxhaNukHdALIyHSHvAkyIPgXjyoP4zI1QsJXj0ZM1 I5JpsL/mo76aZ32iiSPwDb8K/CPT1HlHwhDaS8e3DyYkUZb+kr+33FZ3DQ5qLlF16kYS RwFu3ClHi6TGEcO6syymyuxeE+sOzdyeXb5ibBD+SbKXbTme7ik+BHzAs9LPyVnFKFAK kAYhzBPR5qu2D8Q4ot9UP7mrs4SWA+7G4mdLa6df5rbwbUgY2KlwnRCjUu56tfZfd4EB a5qwh9y8AAPsd2TpXNjBuvbsxHy8EC3p+zY8JxGeAphNd2EEiwK14WTM3ZGqVpwdEp9X TzZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=o/WXNJ1LA673vdJ8sFOa/ninCgRnpi26dheEONfyqB0=; b=e9MMRGK4IXvItIvuVkJytPgQpDIDt5t/VHI0rJo1knZqryKbIwi0HPcHtHDA63RyL7 Zx3UejPdkk1xFKsNeE1iN74qCAyGAqRgjc68LHSRjrZzifXvCTJkDYZLZqtWpH3fBIgJ KDpV39lQZtm3WN0dYCKeOM0vNtcN8QYSMNaRiwP3GD+39d8QJPiE6xvJ2Hfrr9VzJ2il sWS5aqMdgeAvJkNk2ZDiOQ0AjPLywsDT9FO8cAby3juFKphmRzOTNILyxGG1u4SZySxh GSF9R+MnMh1jI/10jWdeLJMpt+56UevsFkZmSpzTFMJRPEEhOJ6zcoyAtoeF4G26Xl0z U0dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NLpmXnv7; 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 d10si5362544ejb.54.2019.11.01.00.45.37; Fri, 01 Nov 2019 00:45:37 -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=NLpmXnv7; 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 S1730126AbfKAHpa (ORCPT + 26 others); Fri, 1 Nov 2019 03:45:30 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55660 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730095AbfKAHp1 (ORCPT ); Fri, 1 Nov 2019 03:45:27 -0400 Received: by mail-wm1-f65.google.com with SMTP id g24so8446741wmh.5 for ; Fri, 01 Nov 2019 00:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o/WXNJ1LA673vdJ8sFOa/ninCgRnpi26dheEONfyqB0=; b=NLpmXnv7R42LKiqA47VpSnkRY8XSxT2H2FVSayMw/zkOdsQZzOkqdbPIQ/zqzCB0db y1kbqWP6t1ZUqf2oG8daRFBPtTfdlI0EhlkJjDINFp0R+3vik28XAfGFzUi/YcMLwbZ4 q5YudIUt0fOEXyeHJzEPJKZHIEheIL/Vl2oW2w92Bksv+d5sT+DP9vkVugFdl/uXBG0Z DTkzSlSAWby6oCttAgyuuRZpASHljJq6nuGd0k9KJ8HyDyz4Gad2Ni90RK5h/+fk+tfK Xxp5P3XYMA0CjrWLUpV8mIegqZNVrZgpJRxOU5z/h2T25UfZimy0TX/BlswzJX++KXp4 KvyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o/WXNJ1LA673vdJ8sFOa/ninCgRnpi26dheEONfyqB0=; b=eVGzx4P+POqAKGQKsZIVuDpl+0V+8aLjhoTH157vEJmiTu4II17RKATrYvNsG6XVGW 237CDOJAuc5P/AnEdokjz7/P2MvJx8EpoKkLTvcAKC8yGoFB9DoXAxq9urcazWs8KnRX S0ReY9357K3A5nVs0EJ2thbmWW3UkYVldpHwBzUtZtD6vWffmgP6YW9ruCqkmW8skU+Q D1PoCwwLwLkezgWKqGzrtmQO3KvKMMcZYHFPaVXz0qv8y+JNEMyJ1VAXjwz17worc+t6 u1m//ASGZkGVBf9n1Z52sQi2d7zgbs7npft9spuneV/0LVq/5vstqnR1Iah0c05aVTyC sMKQ== X-Gm-Message-State: APjAAAU/kqYO7nFU/nnW58jdr+QXSOC6BYse3/2LONyc3gyJfeIvbesq ygu5ETW2pX5HSm9XiGj/cJfjVQ== X-Received: by 2002:a1c:5f04:: with SMTP id t4mr8374156wmb.23.1572594326248; Fri, 01 Nov 2019 00:45:26 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.64]) by smtp.gmail.com with ESMTPSA id b1sm576215wrw.77.2019.11.01.00.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 00:45:25 -0700 (PDT) From: Lee Jones To: daniel.thompson@linaro.org, broonie@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arnd@arndb.de, linus.walleij@linaro.org, baohua@kernel.org, stephan@gerhold.net, Lee Jones Subject: [PATCH v4 04/10] mfd: cs5535-mfd: Register clients using their own dedicated MFD cell entries Date: Fri, 1 Nov 2019 07:45:12 +0000 Message-Id: <20191101074518.26228-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191101074518.26228-1-lee.jones@linaro.org> References: <20191101074518.26228-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Lee Jones Reviewed-by: Daniel Thompson --- drivers/mfd/cs5535-mfd.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c index 3b569b231510..d0fb2e52ee76 100644 --- a/drivers/mfd/cs5535-mfd.c +++ b/drivers/mfd/cs5535-mfd.c @@ -50,16 +50,19 @@ static struct mfd_cell cs5535_mfd_cells[] = { .num_resources = 1, .resources = &cs5535_mfd_resources[PMS_BAR], }, +}; + +static struct mfd_cell cs5535_olpc_mfd_cells[] = { { - .name = "cs5535-acpi", + .name = "olpc-xo1-pm-acpi", + .num_resources = 1, + .resources = &cs5535_mfd_resources[ACPI_BAR], + }, + { + .name = "olpc-xo1-sci-acpi", .num_resources = 1, .resources = &cs5535_mfd_resources[ACPI_BAR], }, -}; - -static const char *olpc_acpi_clones[] = { - "olpc-xo1-pm-acpi", - "olpc-xo1-sci-acpi" }; static int cs5535_mfd_probe(struct pci_dev *pdev, @@ -101,10 +104,14 @@ static int cs5535_mfd_probe(struct pci_dev *pdev, goto err_remove_devices; } - err = mfd_clone_cell("cs5535-acpi", olpc_acpi_clones, - ARRAY_SIZE(olpc_acpi_clones)); + 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 clone MFD cell\n"); + dev_err(&pdev->dev, + "Failed to add CS5535 OLPC sub-devices: %d\n", + err); goto err_release_acpi; } }