Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946AbbEBTAI (ORCPT ); Sat, 2 May 2015 15:00:08 -0400 Received: from mail.savoirfairelinux.com ([209.172.62.77]:65011 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbbEBTAG (ORCPT ); Sat, 2 May 2015 15:00:06 -0400 Date: Sat, 2 May 2015 15:00:01 -0400 (EDT) From: Vivien Didelot To: Florian Fainelli Cc: netdev , linux-kernel , David , Guenter Roeck , Andrew Lunn , kernel Message-ID: <402956743.177307.1430593201959.JavaMail.zimbra@savoirfairelinux.com> In-Reply-To: <671088801.177214.1430592443529.JavaMail.zimbra@savoirfairelinux.com> References: <1430518155-29565-1-git-send-email-vivien.didelot@savoirfairelinux.com> <55440D7D.4060504@gmail.com> <671088801.177214.1430592443529.JavaMail.zimbra@savoirfairelinux.com> Subject: Re: [PATCH 1/3] net: dsa: introduce module_switch_driver macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.6.0_GA_1153 (ZimbraWebClient - FF37 (Linux)/8.6.0_GA_1153) Thread-Topic: introduce module_switch_driver macro Thread-Index: rZSk4X4o8B1YXj60Z/Fg4dbz9m6SuceW/S1x Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1313 Lines: 33 Hi all, >>> This commit introduces a new module_switch_driver macro, similar to >>> module_platform_driver and such, to reduce boilerplate when declaring >>> DSA switch drivers. >>> >>> In order to use the module_driver macro, register_switch_driver needed >>> to be changed to return an int instead of void, so make it return 0. >> >> Do we get much benefit from having this change, the diffstat looks >> pretty neutral, ultimately register_switch_driver() might be gone (see: >> http://www.spinics.net/lists/netdev/msg326900.html) and mv88e6xxx cannot >> be converted to it due to how it is designed. This is not a strong >> objection though, the changes look fine to me. > > Indeed, I initially introduce the macro for that purpose, I have an RFC ready > to remove the mv88e6xxx module and expose its functions, since it'd better be a > library instead of a driver. > > I'll attach it here as a reply to give an idea of what it looks like and > get feedback from you. I messed up with the reply, here's the RFC: https://lkml.org/lkml/2015/5/2/150 Thanks, -v -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/