From patchwork Tue Dec 3 10:04:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21947 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A6B3202AE for ; Tue, 3 Dec 2013 10:04:47 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id fa1sf4692468pad.5 for ; Tue, 03 Dec 2013 02:04:46 -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=n7QNmgIoJ7Ngo3x0YcvRU4vhSKcntcRGhLMWwDwiHCg=; b=aKkEzJBL0C6VtMdD7QhTs3Yk6k40diRIlMqzO1BWyeBh0+ClU0HgCXy3TaOvNjX64q nWzmKbcB4dpwacaviY+LpXIOa/wx/KxfXX4JKIOChzB040yMg/o63t+sKYrrimOB0Y5h Qt0yoSHcyfixN8DvSebPe0fVpHsIgP6/gpxEi2ehHwvVYwQr4OEkvARP4jy51vD+ktUP nUhWgaOgbvA5dK4wHbznUm+y0FESGHOKdIL5gBE32D2X/qOGBOzgAxl7YvOkEMY+r73L zQKZZLP3I8qV1A5ylLCD5dlXF8NQMtjsEHTm/JuzQrgg/sAn8MvpwqnXU4jSA0IbgNty OOLQ== X-Gm-Message-State: ALoCoQk74guG9pMKMUQL89YiNIBGNqotlfAi+uXHGKGSJLSpaad/Nrvt96cA2oJL97//mwK4Vxby X-Received: by 10.67.3.34 with SMTP id bt2mr452218pad.41.1386065086288; Tue, 03 Dec 2013 02:04:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.85.162 with SMTP id i2ls3875984qez.39.gmail; Tue, 03 Dec 2013 02:04:46 -0800 (PST) X-Received: by 10.58.255.71 with SMTP id ao7mr55597905ved.16.1386065086033; Tue, 03 Dec 2013 02:04:46 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id lw10si31114630vec.5.2013.12.03.02.04.45 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.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hz11so9586062vcb.3 for ; Tue, 03 Dec 2013 02:04:45 -0800 (PST) X-Received: by 10.58.54.69 with SMTP id h5mr4679608vep.25.1386065085850; Tue, 03 Dec 2013 02:04:45 -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 u4csp194628vcz; Tue, 3 Dec 2013 02:04:45 -0800 (PST) X-Received: by 10.152.10.99 with SMTP id h3mr47543166lab.13.1386065084962; Tue, 03 Dec 2013 02:04:44 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPS id ww4si18264775lbb.87.2013.12.03.02.04.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:04:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.217.169 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id y6so9007676lbh.28 for ; Tue, 03 Dec 2013 02:04:44 -0800 (PST) X-Received: by 10.152.120.231 with SMTP id lf7mr2943264lab.36.1386065084365; Tue, 03 Dec 2013 02:04:44 -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.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:04:43 -0800 (PST) From: Ulf Hansson To: Russell King , linux-arm-kernel@lists.infradead.org Cc: Ulf Hansson , Greg Kroah-Hartman Subject: [PATCH 2/6] serial: pl010: Convert to modern PM ops Date: Tue, 3 Dec 2013 11:04:27 +0100 Message-Id: <1386065071-9529-3-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.220.172 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-pl010.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index 33bd860..01c9e72 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -756,9 +756,10 @@ static int pl010_remove(struct amba_device *dev) return 0; } -static int pl010_suspend(struct amba_device *dev, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int pl010_suspend(struct device *dev) { - struct uart_amba_port *uap = amba_get_drvdata(dev); + struct uart_amba_port *uap = dev_get_drvdata(dev); if (uap) uart_suspend_port(&amba_reg, &uap->port); @@ -766,15 +767,18 @@ static int pl010_suspend(struct amba_device *dev, pm_message_t state) return 0; } -static int pl010_resume(struct amba_device *dev) +static int pl010_resume(struct device *dev) { - struct uart_amba_port *uap = amba_get_drvdata(dev); + struct uart_amba_port *uap = dev_get_drvdata(dev); if (uap) uart_resume_port(&amba_reg, &uap->port); return 0; } +#endif + +static SIMPLE_DEV_PM_OPS(pl010_dev_pm_ops, pl010_suspend, pl010_resume); static struct amba_id pl010_ids[] = { { @@ -789,12 +793,11 @@ MODULE_DEVICE_TABLE(amba, pl010_ids); static struct amba_driver pl010_driver = { .drv = { .name = "uart-pl010", + .pm = &pl010_dev_pm_ops, }, .id_table = pl010_ids, .probe = pl010_probe, .remove = pl010_remove, - .suspend = pl010_suspend, - .resume = pl010_resume, }; static int __init pl010_init(void)