From patchwork Thu Oct 7 11:20:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12541639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2652AC433F5 for ; Thu, 7 Oct 2021 11:22:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF354610A2 for ; Thu, 7 Oct 2021 11:22:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF354610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hwnvgsiehO6zK4iClOqmn7MKmynErQlL83gkBLp8+L4=; b=0mB4/9fY5LVhP1 vXi3z8vvUX5+zB6bGj1FFF2c7eOUdPW7gb56s0y171i2oQUjhswjrO3CKxQGvJ44MoJ6pbrVo48tO grVNmNTQ9VEUmahTovb7CpwtbA4lPzkqymWrXlqV9mOUrCqJjK3QhmhBxl0zLThSFrKW2AdFXGfV9 UnzoZ6b0psmoDOKlBd+8rdJngdNavDe/+VS5M5w5cVRPJexfG6RZv7b9IlMEpxOM1alMSJcaWSDOf 7jtu6eYQJXSGyrXnLOmLbkX7BRLw/2pI6aB198ziAmasKRHqBWa5lftt1Cvc/wP2qKr8HLvme67Eh HkAQYasd0aGUX0DGmLEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYRRo-00H4fk-8M; Thu, 07 Oct 2021 11:20:24 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYRRk-00H4ew-Bg for linux-arm-kernel@lists.infradead.org; Thu, 07 Oct 2021 11:20:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1633605620; x=1665141620; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vlqZaYyQczlIggc+IIbpxWrZThEF742WAz3RkstZe4s=; b=0+R8783Fsh5UnDKSC6ov2xOeRylhNSMHjm/aB5B59zfiygju1bSlgu8q ELbqqvnmeT8mg1XBdKbUVzXa/l33YCMGeTjxnCFoqXOG4kBsofyJNxr1U ox/i34Rsb4Er2AnsaXadY1Gzr0jvpMlZugB2NlW1Gst4O0CWyCrhyJCYt XENF1y80iWGdHs6MA3mkwl1VSj0zUm+pgfQojnnRTc0CnRdSp8CqfFv7r mLHRZ66jsFqlLHUP8hilBAhOVhfxa+tEqI9qWS1AEjvDPfTup4xbwPdQa 6YDjlJ6YBZ2If5Nc1E0dfNyM5iwU150AWdfARoGfidbAUltMHWDZ8ATvO w==; IronPort-SDR: qmE5LOvtPqMIrGH4sECEK1B7k05SsbM6YvNxX6qhNBM+3Ed2EiSukUXOLG+FusinGfhKCjIR8u bHqnpyaJF2QbujJCTY1kYJiHETbzMqdXEfPz/4qe7jOfIstxef26cwkp8ZwMynSjm8B8gskZE/ dRUWirNrcB94Z87vyFpZ3zObiLcOgusTgzhqbuEI6VNbFlDXs/JzAD+4WpOB5T5HI6Kx/n1Og8 wcJh51OLwoWVUsTJnTVTF3sGPwJec9Jy7bfA5w7juJzaRlCxlwr0zoJWXghpeG1H6AuQ3pAiOH bX9pUsSSetbwBW5JLqZ5+T53 X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="147121102" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Oct 2021 04:20:19 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 7 Oct 2021 04:20:19 -0700 Received: from rob-dk-mpu01.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 7 Oct 2021 04:20:17 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH] tty: serial: atmel: use macros instead of hardcoded values Date: Thu, 7 Oct 2021 14:20:14 +0300 Message-ID: <20211007112014.2332019-1-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211007_042020_447731_CE9FDA6A X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use UART_PM_STATE_ON, UART_PM_STATE_OFF instead of hardcoded values. Signed-off-by: Claudiu Beznea Reviewed-by: Nicolas Ferre Acked-by: Richard Genoud --- drivers/tty/serial/atmel_serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 249ea35088d2..2c99a47a2535 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2084,7 +2084,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state, struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); switch (state) { - case 0: + case UART_PM_STATE_ON: /* * Enable the peripheral clock for this serial port. * This is called on uart_open() or a resume event. @@ -2094,7 +2094,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state, /* re-enable interrupts if we disabled some on suspend */ atmel_uart_writel(port, ATMEL_US_IER, atmel_port->backup_imr); break; - case 3: + case UART_PM_STATE_OFF: /* Back up the interrupt mask and disable all interrupts */ atmel_port->backup_imr = atmel_uart_readl(port, ATMEL_US_IMR); atmel_uart_writel(port, ATMEL_US_IDR, -1);