Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2026248ybd; Sun, 23 Jun 2019 22:45:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEiEQiMzkpqXF30UxTEFX6a2VZlgt3XEa8HZfXsTY8yGkM/nNx6KcrLYU9fcQPgPzf1HUf X-Received: by 2002:a17:902:5c2:: with SMTP id f60mr145166040plf.61.1561355110425; Sun, 23 Jun 2019 22:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561355110; cv=none; d=google.com; s=arc-20160816; b=UlGznJvgwB3yELlbQaLS9VFto5bzCJOHSsZ8eVsQZr5n0q/YMQis3nCyprn1EY547d kbIgb4hz2UYieZCjAIsqr/ZIRWlVMpqs7h+jBZqTJhNNMimXLwx/zsxyeOy21R3isIwY UwIv7GFcfzO8TmdP64H/A1O1jWRyzUmGxjd7e8nEirggEyLc/WoiN8WVP8eOYX2OU3D5 CMhlz2I5rzv35U254REHcwwlEP35m+/+1JT6hvSfql6yYiQp/WnUl/AxSllakRIxXi+E Ugj7JD9ImLKpv/V+fNP6RWiJix21WzWA2iBWjUKakNMzEZkgL1VzexfxWji6+7CQeZMm 2GDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=aODlktChcgk6JLjbo+30yDq11QIUgj6w/Hg+fNTzwyQ=; b=FMV5B1hsmBrKsjqQs87GyUyChlnMHUFSGYJCM6N5po5lkiIXaUWliDW/hCKG3rBeq1 L5cCGnqnpY6XpjzHwJZ9LtX5CZUFZ0q+2DVZc41fk59fAq3hvVU5N9uUsVHJkrHagi8x 92fFrqWWKxx7m9fmUZTCH1EseIFzknKU7+E+LtGR5zoetdCY0lOTjAP2vy76xf8FTo0z iRpquAq79PhL7t3yhUx0+mFeC3mzCWWenSnZuwUltTqkg5SDfsBoUJVpPsiYvkKKXeFR RDVVeeoabWd87TV81w+626FnIDNdScX7dgUSS/ZsNdvTBRAe3Vh1VGNGiMqxaYfn7kTW S+qQ== 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 q11si9395376pgb.78.2019.06.23.22.44.54; Sun, 23 Jun 2019 22:45:10 -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 S1726934AbfFXFkl (ORCPT + 99 others); Mon, 24 Jun 2019 01:40:41 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:52767 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbfFXFkl (ORCPT ); Mon, 24 Jun 2019 01:40:41 -0400 Received: from orion.localdomain ([77.4.138.202]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MRmwM-1i8Ktz3dWc-00TFa1; Mon, 24 Jun 2019 07:40:37 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: kernel@pengutronix.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, t.scherer@eckelmann.de Subject: [PATCH 1/2] siox: add helper macro to simplify driver registration Date: Mon, 24 Jun 2019 07:40:33 +0200 Message-Id: <1561354834-22617-2-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1561354834-22617-1-git-send-email-info@metux.net> References: <1561354834-22617-1-git-send-email-info@metux.net> X-Provags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44cew== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Enrico Weigelt Add more helper macros for trivial driver init cases, similar to the already existing module_platform_driver() or module_i2c_driver(). This helps to reduce driver init boilerplate. Signed-off-by: Enrico Weigelt --- include/linux/siox.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/siox.h b/include/linux/siox.h index a860cb8..da7225b 100644 --- a/include/linux/siox.h +++ b/include/linux/siox.h @@ -72,3 +72,13 @@ static inline void siox_driver_unregister(struct siox_driver *sdriver) { return driver_unregister(&sdriver->driver); } + +/* + * module_siox_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_siox_driver(__siox_driver) \ + module_driver(__siox_driver, siox_driver_register, \ + siox_driver_unregister) -- 1.9.1