From patchwork Thu Mar 28 13:41:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10875015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 540391390 for ; Thu, 28 Mar 2019 13:43:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC5728B78 for ; Thu, 28 Mar 2019 13:43:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EF6928B8B; Thu, 28 Mar 2019 13:43:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 78EE628B78 for ; Thu, 28 Mar 2019 13:43:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2E345871; Thu, 28 Mar 2019 14:43:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2E345871 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1553780634; bh=p7PwyJbzPS6ZtPWSbPMyjqbjuNEteXZ0cBTV3CEzk10=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ctLB/DMks4foaMAA/lkiQkMXSlCHKzMMGocOjcdE1E/nPlt8j7go3kowQj36KKMgq TALIidJotYfPdItf0LhnCeRyjoZr74Z4tZmmV7VPZoXilsx4lCVGiY32Amq/wOkY74 /9CA4M6877et7Y705W4sTgNWJy6/RSfOgj7dFWEc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6DC54F89715; Thu, 28 Mar 2019 14:42:08 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6138F80C16; Thu, 28 Mar 2019 14:42:06 +0100 (CET) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2B3E5F80C16 for ; Thu, 28 Mar 2019 14:42:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2B3E5F80C16 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FDpgkAHX" Received: by mail-wm1-x344.google.com with SMTP id a184so3638430wma.2 for ; Thu, 28 Mar 2019 06:42:01 -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 :mime-version:content-transfer-encoding; bh=iQO9sfNdqBwlZInREZDsg0LeWlaj29IFGs5mv31i9qA=; b=FDpgkAHXVO1+bfCyJDnlUYVqf+Vs58302AZ31H8M82v6aD8BmvuRjrUb/UAzRnFmdA tF6BP38AfB69U/OYZ+49g96aZ1V43xqFryL3kS3hfLijKbmg+EUbxGn0oyxMxLZzXm1p auCZzPVinphKFGRNK30S7wi+E6aNKdatgVFevIWOqPM7xmamRsS3Q6MJpjDRrMohb5cm nZawgFhtnUC1+BhaferLFdD4e8a35WRHaC+sJ22D+fdM6oCQ4hthghgmGLOPn+b99fTO zOtHFdCB4d0LUfS745cyeLtUABqqZU/1QCFPH46lW9iX7pf2NkBk+IklrJdZxX5Ab4Ok zJTg== 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:mime-version:content-transfer-encoding; bh=iQO9sfNdqBwlZInREZDsg0LeWlaj29IFGs5mv31i9qA=; b=YkRh32RmpZjQRTzLsniuXs2RrB8EG0qe3kcaDfIeKwYgK89ZXQVb94ahyxkfDaeNFQ yq0HSkVwy5qaPyGvAM3SvYtjwKj25ubRof3A7Q8xUPTEPSknoK3LABg8nYXowjkcshID JZOxRiHlM/GOgqzSM7uc6kxFThsfXqkRiT9A540+RHCGJoliPTxaDcZCdk9UG6Q1obvU zlELA18C96X5kOmj/b6OwGaci/XgLP+Ny7qT4BlTI3H2laIqjAB+eWittfNnBsqCsVIr B8kJvXZbE1zUihzpCZ3Ao4doWL6eRzX9jueNodbilEVHOxFIv5XnFB0aRzXb224daaMQ 4w5Q== X-Gm-Message-State: APjAAAU45Uix/FJJsaL8CIYt5GuXYt5Yhx5l3Tel1+DIcrtYHw0o6wh9 O65rig1mL7WMgdrxOAj2ZH/ypw== X-Google-Smtp-Source: APXvYqzc0QOhoK/d3kp/sC1+eUa7GYs//SsNSWuLRkMZkNBmHKut2Q4VB/agrPXtjXSwEmFNw6qGHw== X-Received: by 2002:a05:600c:2293:: with SMTP id 19mr24666wmf.77.1553780521332; Thu, 28 Mar 2019 06:42:01 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id e193sm5956374wmg.18.2019.03.28.06.42.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Mar 2019 06:42:00 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Date: Thu, 28 Mar 2019 13:41:31 +0000 Message-Id: <20190328134134.22479-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328134134.22479-1-srinivas.kandagatla@linaro.org> References: <20190328134134.22479-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Cc: sanyog.r.kale@intel.com, Srinivas Kandagatla , pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/4] soundwire: add module_sdw_driver helper macro X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This Helper macro is for Soundwire 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() Signed-off-by: Srinivas Kandagatla --- include/linux/soundwire/sdw_type.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/soundwire/sdw_type.h b/include/linux/soundwire/sdw_type.h index 9fd553e553e9..e14843ed13a5 100644 --- a/include/linux/soundwire/sdw_type.h +++ b/include/linux/soundwire/sdw_type.h @@ -16,4 +16,15 @@ void sdw_unregister_driver(struct sdw_driver *drv); int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size); +/** + * module_sdw_driver() - Helper macro for registering a Soundwire driver + * @__sdw_driver: soundwire slave driver struct + * + * Helper macro for Soundwire 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_sdw_driver(__sdw_driver) \ + module_driver(__sdw_driver, sdw_register_driver, \ + sdw_unregister_driver) #endif /* __SOUNDWIRE_TYPES_H */