From patchwork Fri Sep 26 10:55:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 4981691 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B90EBEEA6 for ; Fri, 26 Sep 2014 11:01:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1E72201FB for ; Fri, 26 Sep 2014 11:00:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A2BA2016C for ; Fri, 26 Sep 2014 11:00:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754861AbaIZK7U (ORCPT ); Fri, 26 Sep 2014 06:59:20 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:60083 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754859AbaIZK6g (ORCPT ); Fri, 26 Sep 2014 06:58:36 -0400 Received: by mail-lb0-f172.google.com with SMTP id p9so13637470lbv.17 for ; Fri, 26 Sep 2014 03:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=t5DZTuicyz+WkFfp05cer93X4Cz0GTwpDBFetrN4j+w=; b=UIX98ndfSCTZKs1ulO3Q3X9yL14ToN0Whlpms3UtzuzM0RAr/7Q45zmpESVukuiy9f aKc+S71tnc2vKs+lGA0f0ekauSZSrPQNkZc9cglazvd/I7n1F4lIzWJl9P73bkaYbIiz sMoESk/qd8U0uNs7A1UyoRf+lCtWkuNt/lwAq4J5BfsVfMCqdztreBO/SRHhPZpI4DdB NCMNPpb4KLVlR+RobDSFrkGlJvp9uc6qO0e5YMsnb28W71o0uDzg+x1AsT/C4OGnFIki 0QqHoEv7Shhzoy7g3hZ7OXwASJycvTg/dsPvDgoIgj/n7iXy9ABxhdjBTWSY6bjC18/w n+Yg== X-Received: by 10.152.42.136 with SMTP id o8mr19411737lal.71.1411729113802; Fri, 26 Sep 2014 03:58:33 -0700 (PDT) Received: from xi.terra (s83-177-171-8.cust.tele2.se. [83.177.171.8]) by mx.google.com with ESMTPSA id vr9sm1777393lbb.36.2014.09.26.03.58.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 03:58:32 -0700 (PDT) X-Google-Original-Sender: Received: from johan by xi.terra with local (Exim 4.80.1) (envelope-from ) id 1XXTBs-0003UF-E7; Fri, 26 Sep 2014 12:55:56 +0200 From: Johan Hovold To: Samuel Ortiz , Lee Jones Cc: Jiri Kosina , linux-input@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH 3/6] mfd: core: add helper function to register hotplug devices Date: Fri, 26 Sep 2014 12:55:30 +0200 Message-Id: <1411728933-13351-4-git-send-email-johan@kernel.org> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1411728933-13351-1-git-send-email-johan@kernel.org> References: <1411728933-13351-1-git-send-email-johan@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hot-pluggable multi-function devices should always be registered with PLATFORM_DEVID_AUTO to avoid name collisions on the platform bus. This helper also hides the memory map and irq parameters, which aren't used by hot-pluggable (e.g. USB-based) devices. Signed-off-by: Johan Hovold --- include/linux/mfd/core.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index f543de91ce19..1e47262a1c63 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -108,6 +108,13 @@ extern int mfd_add_devices(struct device *parent, int id, struct resource *mem_base, int irq_base, struct irq_domain *irq_domain); +static inline int mfd_add_hotplug_devices(struct device *parent, + const struct mfd_cell *cells, int n_devs) +{ + return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs, + NULL, 0, NULL); +} + extern void mfd_remove_devices(struct device *parent); #endif