From patchwork Tue Jun 11 10:40:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 166381 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2182066ilk; Tue, 11 Jun 2019 03:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLFvcS1+NDiE7lsoM5IqYyDuUZ0rEN6koYaZZ1i+Vbf/FDqRQ5vQo9xRWeTZHs9ABmfhql X-Received: by 2002:a17:902:bc43:: with SMTP id t3mr10305427plz.250.1560249665310; Tue, 11 Jun 2019 03:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560249665; cv=none; d=google.com; s=arc-20160816; b=VNpa9hFvh0yjuq1t9wEoiUPF8ub6XnYP79KVo0FodlZCmwKSufkCxnXA6Kg6ikmqbt OWeOcw/xb5tKsp9IkypjCWCPZDzaTCTgFJGicG1rTOQVHgqmd3pmDVsGczWvUnYhnVd2 imxkk3XsZTVNuxXd5o5ienjav55yi6gPuOz4E6yAf6ZrlQ4oU1Wm5+f0I0ZxeQYoEFtl dMnwg5OnGH/XescFgzw191mk5LE7TG2znTzX/isJolfnMa9XJMI6Rl3OmGiIuOv03Lar 6BWkTikkLaiJkQrQpRbALJWshAgXNZ0EoBux9+7l5eIZgltR7tM+Yd+/x79sXV01e2t2 gfYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IyhckBm8THgO1AcZvtqNCZU3xMQ1j3cGrqaXKQ6WbdI=; b=dHPazdqf5agQze6vKGsSfVB2QnRA1P25ZVqbMu0ir7sjfqsbRNIFxLsmehwFYE5bIv 2qq1Ex/+1GogORpKlAnqyKIa0TTZd1epRqRiATCVi91Jrmg1zBUrmuVpcVGp2mADIKCF 2I4VipAtJn36+yYZv5+7XsTcABIKsxRgM04e2OIe0bwE4yzjx35nm3zUYJnmarVMKKZY UZFKmSz7YKbCLDc9TAeiIolJ+6tAkBKaQ3o6YE5y7+HdDYCYYQR9779Qyo8dchQ/fmYx 3V6+hhddw8ZK8fILohuCaYoExzKVueGkXPOB0VzhYdlUYALwL1x7ePKMYLDONRWoWkM3 keBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQg8KvQS; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si7216038pge.116.2019.06.11.03.41.05; Tue, 11 Jun 2019 03:41:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQg8KvQS; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387657AbfFKKlE (ORCPT + 8 others); Tue, 11 Jun 2019 06:41:04 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54662 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387578AbfFKKlE (ORCPT ); Tue, 11 Jun 2019 06:41:04 -0400 Received: by mail-wm1-f66.google.com with SMTP id g135so2377347wme.4 for ; Tue, 11 Jun 2019 03:41:02 -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=IyhckBm8THgO1AcZvtqNCZU3xMQ1j3cGrqaXKQ6WbdI=; b=OQg8KvQSnrphvOofdMTtzsvKGujUIWuYj1y2jJhYsUUJnfc5YvjQgj63rr2m+LiIt0 3imTNZNG8Lci6WAr050UBiTC4xMuRbvBbLj+OzRZF+ZVxes6Rnd6qJSqEi47ylZsZNTz 1bnnmMNh2VzawyKTFMnAQlX0NUbhTQvCyHYk+rrbOLjynzdhyjYgGudPPu2b5peh6e/W WIsWRIui9pT1KXuRPLflunZh5bFKClaFLv7JiUcjVXlhis1ALkbflrNmW51Y/e651F1L xhPAnH8+HBGsLGLVOsysHnb4om4QXPLAeLhS+oCmug5bI2VDO5u19U0uMJotsJxch5ak Ej/w== 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=IyhckBm8THgO1AcZvtqNCZU3xMQ1j3cGrqaXKQ6WbdI=; b=f92zX/3K5+AN2kt6D/Oq547tNzyg6SJ7IDrH6h9E51j4LTGSOmgX2R47h9Jc5u4DUM w9sdTDmSReorws5hLl90Oh5tmCsiUGVP5yyKCXTNj8hAeq5bcKiCk4iDX1TpgSJ3PgJU h8/kNjxM0oBnpWBO81hrTYLQSP1LPGd10RtuGeITkN2Tfoo/CROcNF7Dv4VEFTrzpUm6 A0ZkP1ey8Go5epaACC4uz/YoOXy+l13Cltcwe2CPfrEkb1P/Q5IwQGEz1cUybZHv4F2j q8MF3r9ToVYDkuP3XiY8d9hQMUlazQhL9zKH97noTe4PSuY4IsUZnsQSFMqMywjiZ84V gj7g== X-Gm-Message-State: APjAAAXQWnEDmtLIB9AMf083w7K5t9ALsRjkgw2iNKRQYPyINpUzSI20 lhRmUgmK7IavJW74sqfMHliRoQ== X-Received: by 2002:a1c:6242:: with SMTP id w63mr18506760wmb.161.1560249661813; Tue, 11 Jun 2019 03:41: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 c65sm2359614wma.44.2019.06.11.03.41.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 03:41:01 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, mark.rutland@arm.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, bgoswami@quicinc.com, Srinivas Kandagatla Subject: [RFC PATCH 3/5] soundwire: add module_sdw_driver helper macro Date: Tue, 11 Jun 2019 11:40:41 +0100 Message-Id: <20190611104043.22181-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190611104043.22181-1-srinivas.kandagatla@linaro.org> References: <20190611104043.22181-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 diff --git a/include/linux/soundwire/sdw_type.h b/include/linux/soundwire/sdw_type.h index 9c756b5a0dfe..aaa7f4267c14 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 */