Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7067104ybi; Mon, 22 Jul 2019 06:36:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRU9EjQR8FkUS4aNZD+Ap1iG1vlF/c2bWkGM8Kmbe5B2CNyO/5Cc0BHfwa5M4JQnZsJjdy X-Received: by 2002:a63:4404:: with SMTP id r4mr70698528pga.245.1563802561137; Mon, 22 Jul 2019 06:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563802561; cv=none; d=google.com; s=arc-20160816; b=ZsX2lYEAtDx2JbXrSw1ZNjHmqlyLiNlkrexSNgJY+4NyIdiDh5p8RgQ+rhY5322Hbe oieDD2wKiIz3z5FYLAoTM2Xl1qnQw4lesKB/D93Q5Mb22o11f4FdsN+OOL1i2ERJ3RPl ANxbshmrtvRRYnIekCJif41hv/Y2Q+h1oJA/zzGQGQVNuZ3Ra1W688+F0pjZ54ZEITST p3yrB9m+amfaD8JFNjGdqVAmVuZiocj5xNCUttJgevp2laH+b9bxHp/KU/VhW9tLT2iU X5tEuinFpcRBNK54Bhh75uPEa67rcwzal7oWgvG41Xq/Qynt9n9YiLwb3IFYazTGobPK nnrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=n3HY8sFhMXLvRzQUo9fH2K2vxZYSCI8EuCFwuF/qvoI=; b=aKJG5JtHr1Jm3QbQbmb7xQqTaQnDPTrcmZPTeoni9fdm8MWhoVCw1/AuyYt+XadQLc WkaQJaHJpWchGUNqL944+2LXtCDFJpR07KXt/4Zuv7XMM0TvJjD8460/VmjYkAj2kAnt COfYbjR3Nk+NgdGXIy+zIt6TM02UjC9Gsjzmu3BCsc6PzMhGhth4HICd/teVtK6Zdc8B z0i3Fp4pdrIQNVAgg3r33ohBUTrYqehKFJtM+QED3/sDuClBPkbDo32abE4CwxCZkAoH aYQCWRmBtU0ziOl3wo4/BoYvyQMCff/NrEbRhLhTyPWkhA7t9IFVLdZKU9GDkHF15lco ZzRw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si10390347pgv.304.2019.07.22.06.35.45; Mon, 22 Jul 2019 06:36:01 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730634AbfGVNdm (ORCPT + 99 others); Mon, 22 Jul 2019 09:33:42 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:36392 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730572AbfGVNdY (ORCPT ); Mon, 22 Jul 2019 09:33:24 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 8BD0328B0B1 From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Cc: Jonathan Corbet , Krzysztof Kozlowski , Will Deacon , MyungJoo Ham , Chanwoo Choi , Benson Leung , Guenter Roeck , Jonathan Cameron , Dmitry Torokhov , Mauro Carvalho Chehab , Lee Jones , Sebastian Reichel , Thierry Reding , Alexandre Belloni , Liam Girdwood , Mark Brown , Neil Armstrong , Greg Kroah-Hartman , Collabora kernel ML , Gwendal Grignou Subject: [PATCH v5 10/11] mfd: cros_ec: Use mfd_add_hotplug_devices() helper Date: Mon, 22 Jul 2019 15:32:56 +0200 Message-Id: <20190722133257.9336-11-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722133257.9336-1-enric.balletbo@collabora.com> References: <20190722133257.9336-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use mfd_add_hotplug_devices() helper to register the subdevices. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou Tested-by: Gwendal Grignou --- Changes in v5: None Changes in v4: None Changes in v3: - Add a new patch to use mfd_add_hoplug_devices to register subdevices Changes in v2: None drivers/mfd/cros_ec_dev.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index 38627f6b78af..4f0451090a27 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -328,10 +328,8 @@ static void cros_ec_accel_legacy_register(struct cros_ec_dev *ec) * Register 2 accelerometers, we will fail in the IIO driver if there * are no sensors. */ - ret = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO, - cros_ec_accel_legacy_cells, - ARRAY_SIZE(cros_ec_accel_legacy_cells), - NULL, 0, NULL); + ret = mfd_add_hotplug_devices(ec->dev, cros_ec_accel_legacy_cells, + ARRAY_SIZE(cros_ec_accel_legacy_cells)); if (ret) dev_err(ec_dev->dev, "failed to add EC sensors\n"); } @@ -417,10 +415,8 @@ static int ec_device_probe(struct platform_device *pdev) * The following subdevices cannot be detected by sending the * EC_FEATURE_GET_CMD to the Embedded Controller device. */ - retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO, - cros_ec_platform_cells, - ARRAY_SIZE(cros_ec_platform_cells), - NULL, 0, NULL); + retval = mfd_add_hotplug_devices(ec->dev, cros_ec_platform_cells, + ARRAY_SIZE(cros_ec_platform_cells)); if (retval) dev_warn(ec->dev, "failed to add cros-ec platform devices: %d\n", @@ -429,10 +425,8 @@ static int ec_device_probe(struct platform_device *pdev) /* Check whether this EC instance has a VBC NVRAM */ node = ec->ec_dev->dev->of_node; if (of_property_read_bool(node, "google,has-vbc-nvram")) { - retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO, - cros_ec_vbc_cells, - ARRAY_SIZE(cros_ec_vbc_cells), - NULL, 0, NULL); + retval = mfd_add_hotplug_devices(ec->dev, cros_ec_vbc_cells, + ARRAY_SIZE(cros_ec_vbc_cells)); if (retval) dev_warn(ec->dev, "failed to add VBC devices: %d\n", retval); -- 2.20.1