From patchwork Tue Mar 5 03:23:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2216431 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E45113FCF6 for ; Tue, 5 Mar 2013 03:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932483Ab3CEDeV (ORCPT ); Mon, 4 Mar 2013 22:34:21 -0500 Received: from mail-pb0-f51.google.com ([209.85.160.51]:56849 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932472Ab3CEDeU (ORCPT ); Mon, 4 Mar 2013 22:34:20 -0500 Received: by mail-pb0-f51.google.com with SMTP id un15so3792588pbc.38 for ; Mon, 04 Mar 2013 19:34:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=KlmKWUzM66iRXzvCbrForwY67L+4LNX8eRFE7y3AALw=; b=S2NznUfFwBmXUJnX29/DAqG81MNFER+m9mZIfLpVfpoRQtHvC90YNi9ezfZmEGhpU+ FGH/A+f6oKs/cnQANCizWPq0dlsg8lts+9qBEpE60VJb/g5MqYGReJvrMxeNF7ZfylEG XJELup2hF8o5/WGSbHJjMqX3WNTcPMQOKBylr0GGF0WnGFLV5B3lqHXDC8cCiQYXGvIT cphD0rA+EPGdLClIWfiBVMlTK1OhG3XNJ3WLpPBMnidsL9JIHIUDIVVyHr4A7Bpxq9l2 JOvhfNiLQXLgr/2/V8bydyPPvIzXmE2tC818/lwo8f14pEeVeDbrzMxSq5CkNBgB8WzH tPNg== X-Received: by 10.68.224.1 with SMTP id qy1mr34255203pbc.169.1362454459566; Mon, 04 Mar 2013 19:34:19 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id in5sm24712358pbc.20.2013.03.04.19.34.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 19:34:19 -0800 (PST) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 2/8] Input: twl4030-pwrbutton: module_platform_driver_probe macro Date: Tue, 5 Mar 2013 08:53:41 +0530 Message-Id: <1362453827-18129-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1362453827-18129-1-git-send-email-sachin.kamat@linaro.org> References: <1362453827-18129-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkQU4cA2lKrgvCOUVn6AIGlPfpHkYhYWUksuyecBWgUrrDCQYqin/A09+3FjO4W5BvWIrG8 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org module_platform_driver_probe() eliminates the boilerplate and simplifies the code. Signed-off-by: Sachin Kamat --- drivers/input/misc/twl4030-pwrbutton.c | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index 27c2bc8..b9a05fd 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -114,18 +114,8 @@ static struct platform_driver twl4030_pwrbutton_driver = { }, }; -static int __init twl4030_pwrbutton_init(void) -{ - return platform_driver_probe(&twl4030_pwrbutton_driver, +module_platform_driver_probe(twl4030_pwrbutton_driver, twl4030_pwrbutton_probe); -} -module_init(twl4030_pwrbutton_init); - -static void __exit twl4030_pwrbutton_exit(void) -{ - platform_driver_unregister(&twl4030_pwrbutton_driver); -} -module_exit(twl4030_pwrbutton_exit); MODULE_ALIAS("platform:twl4030_pwrbutton"); MODULE_DESCRIPTION("Triton2 Power Button");