From patchwork Tue Dec 3 10:04:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21948 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 18391202DA for ; Tue, 3 Dec 2013 10:04:48 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 5sf32773312qeb.3 for ; Tue, 03 Dec 2013 02:04:47 -0800 (PST) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=1sWYVgXM0OVYDJStP2zCp8DAd7doIy+7/9SMKt8eDsg=; b=HtsRrlwbmLHuzqvawxohbq58a2Whx2+X7wfvYcDA7lEbAfIwHyAk4b1cr3NyZkTzmw S2cuPA9e1w55ytcV8bsZxPvQvyUd5AYpcOmiyGhj22WwOQS+T1lGJ00td9r2xslptINK 0uD1kA71avM4ckt7T9rPEjmKUDfN4EThWZ1r01f6jxg0W6SWXGuPrnpmFiKR3KFzMULb pxNuXmTW98FvedYwx/sHf1FMb9ZzV3pjBYvLzMGJflq0PWJUiQ62DUbYeKOSplUgW4tO ppEK9YhRHwGlPSR4/P3/OTXIgSHXkAlXPHVweTvNj0bL5ZKNVULwQKHOUXzkpChsLyVR WRQw== X-Gm-Message-State: ALoCoQl9H2gkPiztka96UmSOiLivYRsqCrY0gOZOFL5C0Cz7v7BUIJeyNZQ2vQXqZY6djan74aKt X-Received: by 10.58.75.199 with SMTP id e7mr21620981vew.20.1386065087862; Tue, 03 Dec 2013 02:04:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.163 with SMTP id z3ls2922232qej.1.gmail; Tue, 03 Dec 2013 02:04:47 -0800 (PST) X-Received: by 10.52.162.74 with SMTP id xy10mr60132vdb.65.1386065087767; Tue, 03 Dec 2013 02:04:47 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id x1si2550925vdo.133.2013.12.03.02.04.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:04:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so9810182veb.2 for ; Tue, 03 Dec 2013 02:04:47 -0800 (PST) X-Received: by 10.58.155.162 with SMTP id vx2mr35378veb.46.1386065087405; Tue, 03 Dec 2013 02:04:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp194631vcz; Tue, 3 Dec 2013 02:04:47 -0800 (PST) X-Received: by 10.152.116.46 with SMTP id jt14mr2960690lab.31.1386065086493; Tue, 03 Dec 2013 02:04:46 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id ww4si18263823lbb.72.2013.12.03.02.04.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:04:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.217.179 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so8706357lbv.38 for ; Tue, 03 Dec 2013 02:04:46 -0800 (PST) X-Received: by 10.152.115.130 with SMTP id jo2mr6869919lab.2.1386065085925; Tue, 03 Dec 2013 02:04:45 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id i8sm35583394lbh.2.2013.12.03.02.04.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:04:45 -0800 (PST) From: Ulf Hansson To: Russell King , linux-arm-kernel@lists.infradead.org Cc: Ulf Hansson , Greg Kroah-Hartman Subject: [PATCH 3/6] serial: pl011: Convert to modern PM ops Date: Tue, 3 Dec 2013 11:04:28 +0100 Message-Id: <1386065071-9529-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386065071-9529-1-git-send-email-ulf.hansson@linaro.org> References: <1386065071-9529-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Convert to modern PM ops and use the SIMPLE_DEV_PM_OPS macro to set up the PM callbacks. Cc: Greg Kroah-Hartman Signed-off-by: Ulf Hansson --- drivers/tty/serial/amba-pl011.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 7203864..1273777 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2169,10 +2169,10 @@ static int pl011_remove(struct amba_device *dev) return 0; } -#ifdef CONFIG_PM -static int pl011_suspend(struct amba_device *dev, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int pl011_suspend(struct device *dev) { - struct uart_amba_port *uap = amba_get_drvdata(dev); + struct uart_amba_port *uap = dev_get_drvdata(dev); if (!uap) return -EINVAL; @@ -2180,9 +2180,9 @@ static int pl011_suspend(struct amba_device *dev, pm_message_t state) return uart_suspend_port(&amba_reg, &uap->port); } -static int pl011_resume(struct amba_device *dev) +static int pl011_resume(struct device *dev) { - struct uart_amba_port *uap = amba_get_drvdata(dev); + struct uart_amba_port *uap = dev_get_drvdata(dev); if (!uap) return -EINVAL; @@ -2191,6 +2191,8 @@ static int pl011_resume(struct amba_device *dev) } #endif +static SIMPLE_DEV_PM_OPS(pl011_dev_pm_ops, pl011_suspend, pl011_resume); + static struct amba_id pl011_ids[] = { { .id = 0x00041011, @@ -2210,14 +2212,11 @@ MODULE_DEVICE_TABLE(amba, pl011_ids); static struct amba_driver pl011_driver = { .drv = { .name = "uart-pl011", + .pm = &pl011_dev_pm_ops, }, .id_table = pl011_ids, .probe = pl011_probe, .remove = pl011_remove, -#ifdef CONFIG_PM - .suspend = pl011_suspend, - .resume = pl011_resume, -#endif }; static int __init pl011_init(void)