From patchwork Wed Jul 22 07:55:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 51334 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id DB0CD20323 for ; Wed, 22 Jul 2015 07:56:22 +0000 (UTC) Received: by lbcjj5 with SMTP id jj5sf20529464lbc.1 for ; Wed, 22 Jul 2015 00:56:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=JFflUApYkcTcHqhez/FKo5Wz4IP6eyvwps2PSaKLrMM=; b=DBYM/GwO2HotZ31TPwZDhU1RyHzBLRURly7xCP/aUcTottt8C/XXuEEWi4odgLluPp 3YHT2eEAG8OBvZBWh6Y/IlbA101gTYkll/VE+Cp5Z3aOLM+Onlt1T/hzIuXe0l/Bw2Rz DZm5X2X8OmfcYB8ZaZAcTrNZlZmIIKR4EzJL7ugB6fgnKek8UtHLTm2zFvs8Fy1JSwa4 496mXZ1hfEkdrrkB5BmZFw37w0tI0l3wcfFzpHH4yw2A72sQtcFHHVUQm6EWQTv6VXkC 3fj9FZTWc4tZdSTvTVlP8pELa0m3KFkeV/8hZ/+OQshyjFxLgkfb3vm5vwz9O3PzTYj6 Zu7g== X-Gm-Message-State: ALoCoQkLTH26p4cxWHwTZvlC4bIzbqbZ3VPHyTNLcKlbt+PhrHSf5gXr9qWO39IKex7wy9KjKgH6 X-Received: by 10.152.28.100 with SMTP id a4mr608607lah.4.1437551781804; Wed, 22 Jul 2015 00:56:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.1 with SMTP id g1ls41471lag.46.gmail; Wed, 22 Jul 2015 00:56:21 -0700 (PDT) X-Received: by 10.152.87.131 with SMTP id ay3mr1071206lab.27.1437551781494; Wed, 22 Jul 2015 00:56:21 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id n4si540948lbc.63.2015.07.22.00.56.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 00:56:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laah7 with SMTP id h7so1571655laa.0 for ; Wed, 22 Jul 2015 00:56:21 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr1109051lbb.36.1437551781391; Wed, 22 Jul 2015 00:56:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1927984lba; Wed, 22 Jul 2015 00:56:20 -0700 (PDT) X-Received: by 10.66.55.41 with SMTP id o9mr3113315pap.148.1437551779363; Wed, 22 Jul 2015 00:56:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz3si1903464pdb.69.2015.07.22.00.56.18; Wed, 22 Jul 2015 00:56:19 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932921AbbGVH4F (ORCPT + 28 others); Wed, 22 Jul 2015 03:56:05 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:33451 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756048AbbGVH4D (ORCPT ); Wed, 22 Jul 2015 03:56:03 -0400 Received: by laah7 with SMTP id h7so1566828laa.0 for ; Wed, 22 Jul 2015 00:56:01 -0700 (PDT) X-Received: by 10.112.217.2 with SMTP id ou2mr1085913lbc.15.1437551761274; Wed, 22 Jul 2015 00:56:01 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id ok2sm137093lbb.0.2015.07.22.00.55.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 00:56:00 -0700 (PDT) From: Linus Walleij To: Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org Cc: Linus Walleij Subject: [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver Date: Wed, 22 Jul 2015 09:55:43 +0200 Message-Id: <1437551743-20599-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437551743-20599-1-git-send-email-linus.walleij@linaro.org> References: <1437551743-20599-1-git-send-email-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signal that this is a builting driver and call its probe function immediately on init. Suppress binding attributes and delete the .remove() function since it is never unloaded. Tag probe() and functions only called from probe() with __init. Delete all module macros since this is a pure builtin. Signed-off-by: Linus Walleij --- drivers/mfd/ipaq-micro.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c index 9bfe2462c5c5..a41859c55bda 100644 --- a/drivers/mfd/ipaq-micro.c +++ b/drivers/mfd/ipaq-micro.c @@ -242,7 +242,7 @@ static u16 ipaq_micro_to_u16(u8 *data) return data[1] << 8 | data[0]; } -static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro) +static void __init ipaq_micro_eeprom_dump(struct ipaq_micro *micro) { u8 dump[256]; char *str; @@ -386,7 +386,7 @@ static int micro_resume(struct device *dev) return 0; } -static int micro_probe(struct platform_device *pdev) +static int __init micro_probe(struct platform_device *pdev) { struct ipaq_micro *micro; struct resource *res; @@ -448,21 +448,6 @@ static int micro_probe(struct platform_device *pdev) return 0; } -static int micro_remove(struct platform_device *pdev) -{ - struct ipaq_micro *micro = platform_get_drvdata(pdev); - u32 val; - - mfd_remove_devices(&pdev->dev); - - val = readl(micro->base + UTCR3); - val &= ~(UTCR3_RXE | UTCR3_RIE); /* disable receive interrupt */ - val &= ~(UTCR3_TXE | UTCR3_TIE); /* disable transmit interrupt */ - writel(val, micro->base + UTCR3); - - return 0; -} - static const struct dev_pm_ops micro_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(NULL, micro_resume) }; @@ -471,11 +456,7 @@ static struct platform_driver micro_device_driver = { .driver = { .name = "ipaq-h3xxx-micro", .pm = µ_dev_pm_ops, + .suppress_bind_attrs = true, }, - .probe = micro_probe, - .remove = micro_remove, }; -module_platform_driver(micro_device_driver); - -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("driver for iPAQ Atmel micro core and backlight"); +builtin_platform_driver_probe(micro_device_driver, micro_probe);