Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp871585pxk; Thu, 17 Sep 2020 19:52:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh72p7WpJ5ujB3o9ssKSWWZ4L2X3yIfRxQLAZY9NTycUCMX88suQsUJgu5Qzw+pOhycAZD X-Received: by 2002:a17:906:1787:: with SMTP id t7mr35111812eje.173.1600397521940; Thu, 17 Sep 2020 19:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397521; cv=none; d=google.com; s=arc-20160816; b=JNy+7ip1VjnM0zjlUNdZzQn6QGM8l7QggVSGvuWUEDc4EGiGGL8p3699FXjMa/Qvox KqXEn0IdHvBOlws+q9e9BHTLQ0LlIoWfdzC51bSagZNmRyOAkBqSSRCzLYdl9eksAEGc xOhxR+4sA7uIHXvH2B9wds0WzFH2fiRzz8RAR1Voezmr0JpAy+xrBWPXK0U/nEp9IkbG ieM0BhlvJ/RAdNWUTMAnrSunSvnm0bI0nv72tcZk0DpLaqNhCMRt66IRKYZFignC4QcX kVf7gOx2yDyWI8tgGOq2KzYtudszMMPNnhMY/JzzUc0qfgfbwtLxnXFPYcEhBrRXkGnQ ZsIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2oa7sLGQb8q4Q+yxO1cf1tSghjsIcNdAFkUQbN1gbIw=; b=j4iUMQwdttuUzwrKTqUky7V9yljXRaM5oaLt2VH/a0UHVHJdA2cT6kofV7KYXVTU+v YupKEM4c8+EYR7k5PI4yrgK61rvjLo69rl51gXqhxiXsRXxGKbeMpLAc5XYSX+1cO537 QzBvsrLV5TdtzhGGZCpD9KQiZweiCDKgRGeY3Z+oBAsPl4ebehUI6prhfOggJWzxuqIj zQka5ALzVxOOxec59RZQ4Ji8twidYLjSs9Qtk0pjqKuC6WOqqt5qLmD3Za69jhL5KuKC OMxj2VudeEW7YqOaJhgb/s08IwAw9zE2rVkpAdPqlXMye1I+oqoG6Nknrdm6CYUoQMiP MJlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si1093419edv.524.2020.09.17.19.51.38; Thu, 17 Sep 2020 19:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730079AbgIRCr5 (ORCPT + 99 others); Thu, 17 Sep 2020 22:47:57 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:57414 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729200AbgIRCrx (ORCPT ); Thu, 17 Sep 2020 22:47:53 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3F78ACBDC176CC835473; Fri, 18 Sep 2020 10:47:50 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 10:47:41 +0800 From: Liu Shixin To: Greg Kroah-Hartman CC: , , Liu Shixin Subject: [PATCH -next] usb: appledisplay: use module_usb_driver to simplify the code Date: Fri, 18 Sep 2020 11:10:12 +0800 Message-ID: <20200918031012.3980558-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org module_usb_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Liu Shixin --- drivers/usb/misc/appledisplay.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 36fed1a09666..c8098e9b432e 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -342,20 +342,8 @@ static struct usb_driver appledisplay_driver = { .disconnect = appledisplay_disconnect, .id_table = appledisplay_table, }; - -static int __init appledisplay_init(void) -{ - return usb_register(&appledisplay_driver); -} - -static void __exit appledisplay_exit(void) -{ - usb_deregister(&appledisplay_driver); -} +module_usb_driver(appledisplay_driver); MODULE_AUTHOR("Michael Hanselmann"); MODULE_DESCRIPTION("Apple Cinema Display driver"); MODULE_LICENSE("GPL"); - -module_init(appledisplay_init); -module_exit(appledisplay_exit); -- 2.25.1