From patchwork Thu May 14 21:05:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 6409761 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C5D1F9F318 for ; Thu, 14 May 2015 21:11:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFDBC20490 for ; Thu, 14 May 2015 21:11:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8662420480 for ; Thu, 14 May 2015 21:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030192AbbENVLV (ORCPT ); Thu, 14 May 2015 17:11:21 -0400 Received: from hauke-m.de ([5.39.93.123]:51462 "EHLO hauke-m.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932953AbbENVLU (ORCPT ); Thu, 14 May 2015 17:11:20 -0400 X-Greylist: delayed 319 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 May 2015 17:11:20 EDT Received: from hauke-desktop.fritz.box (p5DE94812.dip0.t-ipconnect.de [93.233.72.18]) by hauke-m.de (Postfix) with ESMTPSA id 2C13B20166; Thu, 14 May 2015 23:05:58 +0200 (CEST) From: Hauke Mehrtens To: kvalo@codeaurora.org Cc: zajec5@gmail.com, linux-wireless@vger.kernel.org, Hauke Mehrtens Subject: [PATCH] bcma: add module_bcma_driver() Date: Thu, 14 May 2015 23:05:49 +0200 Message-Id: <1431637549-18611-1-git-send-email-hauke@hauke-m.de> X-Mailer: git-send-email 2.1.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 This makes it possible to save some lines of code in drivers with an simple bcma driver registration. Signed-off-by: Hauke Mehrtens --- include/linux/bcma/bcma.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index e34f906..2ff4a99 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h @@ -305,6 +305,15 @@ int __bcma_driver_register(struct bcma_driver *drv, struct module *owner); extern void bcma_driver_unregister(struct bcma_driver *drv); +/* module_bcma_driver() - Helper macro for drivers that don't 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_bcma_driver(__bcma_driver) \ + module_driver(__bcma_driver, bcma_driver_register, \ + bcma_driver_unregister) + /* Set a fallback SPROM. * See kdoc at the function definition for complete documentation. */ extern int bcma_arch_register_fallback_sprom(