Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3295170imc; Wed, 13 Mar 2019 14:03:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ0qICikUnxUMV1cLgmB3r4nq9plb1cdZzMuYVeNq91Kb62EMmjXk5TWyhl2ma4BY6qa4M X-Received: by 2002:a63:2a86:: with SMTP id q128mr15211915pgq.424.1552511028609; Wed, 13 Mar 2019 14:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552511028; cv=none; d=google.com; s=arc-20160816; b=bgojNtSDjVE9iVw7WODTJE7AOXKMXiROzYJ1MFG+cY/2mWb8ir8HooDlb38F0yBBTG HSIE0VULw01A0FZDHlB1gEtauKDPL89fv+VBaagAHoC6kV6Bz64+rrhdSbSBIlSLKSlB IeMdsnK9blFBDLPNW7jOfoivGZNW7dLFvrBbJ7lnSJ7N/TY2l9AyduWrzrbMYX/SQb+U CCUpFzGJ1Ihi7oy9LdcD5B/Qa4xpToqe1v3AdKWZx0oNile4NhWRwWyMUItZHnTrJb3k Ozjxd7jp3AMtjJtiyv+VUGJTQBc12od9yGMV7FZa8blgfEYZXXvonr60MYVIh6kf63Y6 ETCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=ybjgx3h8V5zXqP0xvoeH/n1lJPMJXSmtMdXCGr6+Ikg=; b=s4LdyopL+zoJRHGWlExDgPSbrVEFe/sGtfgppAfOEw98PXBJvaLEosvGIrEyD5lu9+ xuwjtSMDCW/SttP/0hsh/tGbHAkqC+/V2C5POLfE8/XrWreeQd0AJJvtEhzRQrzGcGsJ ps+KBE1zN12WoIbKgKFrwiqfaQq2trdFPLRRxFiji8zKxaLlwXJazS/djNoIxdYUZZ6X 8KLZfYIjNZ+BsJCR9+KHM3n5XNGIvm5eXagQDwGkGNR4B+UwxSMF2O8nOyhcNF1CF8p0 ODJYtJvRT0D2KZpM/EItFjote8y5mEsgIgjmSe7uTKuPc2i/1EKoJDEp5F3BFJjpmDW3 REVA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si10529430pgr.551.2019.03.13.14.03.32; Wed, 13 Mar 2019 14:03:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbfCMVCO (ORCPT + 99 others); Wed, 13 Mar 2019 17:02:14 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:43850 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727408AbfCMVCM (ORCPT ); Wed, 13 Mar 2019 17:02:12 -0400 X-UUID: ed3b61a1eaac4deeb74d58a6cd866892-20190314 X-UUID: ed3b61a1eaac4deeb74d58a6cd866892-20190314 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1527846795; Thu, 14 Mar 2019 05:02:05 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 14 Mar 2019 05:02:02 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 14 Mar 2019 05:02:02 +0800 From: To: , , CC: , , , , Sean Wang Subject: [PATCH v1 1/3] mmc: sdio: Add helper macro for sdio_driver boilerplate Date: Thu, 14 Mar 2019 05:01:58 +0800 Message-ID: <6cb7e75934bc7ac56a0e7c6cbbc963f98a6730b0.1552510141.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 2E3F0C2F8990CB64BF5F3A34A71FAA3BF2422B16F826775C7306C7D187773D6C2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang This patch introduces the module_sdio_driver macro which is a convenience macro for SDIO driver modules similar to module_usb_driver. It is intended to be used by drivers which init/exit section does nothing but register/ unregister the SDIO driver. By using this macro it is possible to eliminate a few lines of boilerplate code per SDIO driver. Cc: Ulf Hansson Suggested-by: Marcel Holtmann Signed-off-by: Sean Wang --- include/linux/mmc/sdio_func.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 97ca105347a6..5685805533b5 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h @@ -111,6 +111,18 @@ struct sdio_driver { extern int sdio_register_driver(struct sdio_driver *); extern void sdio_unregister_driver(struct sdio_driver *); +/** + * module_sdio_driver() - Helper macro for registering a SDIO driver + * @__sdio_driver: sdio_driver struct + * + * Helper macro for SDIO drivers which do not do anything special in module + * init/exit. This eliminates a lot of boilerplate. Each module may only + * use this macro once, and calling it replaces module_init() and module_exit() + */ +#define module_sdio_driver(__sdio_driver) \ + module_driver(__sdio_driver, sdio_register_driver, \ + sdio_unregister_driver) + /* * SDIO I/O operations */ -- 2.18.0