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: 161304 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp730681jan; Thu, 28 Mar 2019 06:43:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUxN7AC8986UEJkF81TT7/pFAOeqSEgL6yJIknUJ/ITnDS7wEfCysGVvInDBkbu3Lrq//o X-Received: by 2002:a5d:530e:: with SMTP id e14mr5099442wrv.18.1553780635009; Thu, 28 Mar 2019 06:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553780635; cv=none; d=google.com; s=arc-20160816; b=IPTZtlZv1ELFMFbqu8/kCXCJf6zKosqCFAIvyTLxgmpVR2V2LY/7eql79FUG0TMpJw pRaWt4EHHprjHUDqHSotVHy+q4k1bS+q9lD33JrESvqnoxcLmiOdJIxgjqNjiYtPNAE9 ue8tNk2b6Bj1Wc1JIe5USMiJG9S9FpN8IdsPsfdBL6Zbch0WOmqaojScJveQDC7PrOjs 9w6ZhGJONGXt7nF0okVyG1hpDBuvxO2ksWr05JeBXLyjkTdHyDkP2BygQgBVL4NT+7vW 0z5ai0ztbZRMZZoK4KSbCBKGqM0HMyhW2vUIjKq9V73/KWIv1fdTBjD5FHk9/d0rXG0p gL1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-filter:delivered-to:dkim-signature:dkim-filter; bh=zQp/+b8HLnXNI7eZXBAHOSfLYJmJdIUtdZQGBCCSQeM=; b=uNqkuz14V4K2xi0gNrYhQdFsxN8gSSaX/NGsfP0Bz2UE+Wikm7tMtSgfpI8y7oNkYu DSSnLWeLKtzcA5PRXUFEojBH5iRyrGmvnLcR43dFtN9JN/OBiI5kcG3al0dOkw76MBWl yiaRsqTMSYTt3UFJNaY/EwXbiPt7GX7MUN7bFhNKyxtxk9XBHZR8/et2bbiKudzRFyEe HYim7EXpfDrfObtI+O+4Ljiz825RLAtgO+ftE4YMVnbOUbSa9Rjoq2SJrkHHATSLbEDH XrvRoWlWks/4voqqBJlaTt+pohhv0bRqk6VR6M6Ka5fIEvlyWEm/4cEpgnHWG0tzXiFg CxzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b="ctLB/DMk"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FDpgkAHX; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTPS id f12si15723408wrj.229.2019.03.28.06.43.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 06:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b="ctLB/DMk"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FDpgkAHX; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 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-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" 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(+) -- 2.21.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel 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 */