From patchwork Mon Mar 7 08:08:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771336 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 737D7C433EF for ; Mon, 7 Mar 2022 08:10:21 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KqDwYoxvBz1UY7RwIdtrg1wna6xeHyz131GM0Z//uYM=; b=QZZF/sMIJPgmgX SXHBre8YFYaMhRTlcFaI5+T84bi32SMSSebUHeUM/z0SEkoJ3tmO+CW8ezbIx4LPthYJzGQq5aNOE gowwHo8UCvw270rEBCrNPxseVFJDV2qKpW0nY5n83lr2t2nlnxHTfl1periR46TbJZbnq+6Uy4Rxw fPjtkPK8sPhkiaxNxhxaP9SV6z5chw67P12gInSTHg+BdHiX15jPZNi4OYMXNdAfECuj7b9LqtCG0 z/Q3JQX7KClcQ8E1M4d4v0LT5lcMaBwNmTvXRaSgvz1olctefsN+xRWTVx7dtc+KFb7sgg7fcQ1qg p+n8vD/kY9u69Phsrt5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8QO-00GOMb-VY; Mon, 07 Mar 2022 08:09:01 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8QL-00GOLy-LA for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:08:59 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 67C253F1E6 for ; Mon, 7 Mar 2022 08:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640536; bh=eR7Mc9vi/w7iGpwa309YiCzl9zkdxojESdgSBLZGEv4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R81s1GPZTAEF2514u2X0xKw4b7uAGvtb3FeA0YxRCL137tF3Z0Gf1o5/4jOoq0Q2/ BVx3nsuNdFAMHnV7Pf1QsbGqfiVkIdFnScqoFBJLo1ywoMHb5B3oR9MFmJ34gXlI1p OktFSkqZvDEvd6a14akeyY30zfHi7KRG94+rypn/K7bSq2R20wzEIhR+rm0HkDsbA5 7fCOg4m2Pm+zoTt+Uu6DIBoYsAJtHXu/nlkhYDOUnBTesc0Ey4RbPqNXYAx0t30d6h vozDpUduxkmDXa2EWvG1d1V2eLwSvKNH//m6d/xf84S715kyrH/yd0kAV9LW2cIdDw s4fNouITcRNFw== Received: by mail-ej1-f70.google.com with SMTP id og24-20020a1709071dd800b006dab87bec4fso3155134ejc.0 for ; Mon, 07 Mar 2022 00:08:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eR7Mc9vi/w7iGpwa309YiCzl9zkdxojESdgSBLZGEv4=; b=B7l1S8xWw1MSvASpgIkIybNlqdV49tCwnYE9CnopLV2ooRb0RH//Au6DL4SkzXgKa9 R2z3uVcIRlT055J/JQJ/dPg+WFnEF6Cj3b1BT8IhB2pxxAdlObDhVRtbBSpqgwBJj3/+ 0ibw3duU6WyVHp9sUc9eqZ7lNWQMkEGuDkQnKRv1zaTmHmX7NUWt7WdBNNKZBz0rh+xF i3BPoYWNvRVZ1/YdQBjnt9r51FMt8qvPTqS4vjP7E8nPN5dQ3qXOm/EQETtRrWgjThrz BCWivek32iZ0+uMOi/L8+Q0fsY3XU0WwwhsQ121xEXMsfz1mN6AuKtaGoGS58QQfgA6E x+WQ== X-Gm-Message-State: AOAM533U8p+vV0mXnCNUUZk00pV3H3bCh56qE+/DI5QmqNROcO6wsFQa WIxTk19ZxPTOQNiD1E3DHrM9UY4pnPfEtDEMItfozmBgfuhLiy3SsXsth61Glt86J1E3tkz/1P1 adNuWopcKTz0rpSXKl2uvN8c62XRk66TvuTGUQftugGh0HnlGiJvV X-Received: by 2002:a17:907:d06:b0:6da:2902:e9ad with SMTP id gn6-20020a1709070d0600b006da2902e9admr8377713ejc.566.1646640535812; Mon, 07 Mar 2022 00:08:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCbsSDsaeQ5A3m0lusAuFH7GkNNgJvj5FHMB6/pMQ6cGRuCsKahqtP+fbfKW0QoSgQklboFw== X-Received: by 2002:a17:907:d06:b0:6da:2902:e9ad with SMTP id gn6-20020a1709070d0600b006da2902e9admr8377700ejc.566.1646640535645; Mon, 07 Mar 2022 00:08:55 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id s21-20020a170906961500b006daac87ddb0sm3698300ejx.140.2022.03.07.00.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:08:55 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/7] tty: serial: samsung: embed s3c24xx_uart_info in parent structure Date: Mon, 7 Mar 2022 09:08:46 +0100 Message-Id: <20220307080852.53992-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000857_834397_8DB95ED2 X-CRM114-Status: GOOD ( 16.78 ) 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 Embed "struct s3c24xx_uart_info" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "struct s3c24xx_serial_drv_data") and saves one pointer. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby --- drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index d002a4e48ed9..aa5678d03704 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -85,7 +85,7 @@ struct s3c24xx_uart_info { }; struct s3c24xx_serial_drv_data { - struct s3c24xx_uart_info *info; + struct s3c24xx_uart_info info; struct s3c2410_uartcfg *def_cfg; unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; }; @@ -2197,7 +2197,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) } ourport->baudclk = ERR_PTR(-EINVAL); - ourport->info = ourport->drv_data->info; + ourport->info = &ourport->drv_data->info; ourport->cfg = (dev_get_platdata(&pdev->dev)) ? dev_get_platdata(&pdev->dev) : ourport->drv_data->def_cfg; @@ -2616,7 +2616,7 @@ static struct console s3c24xx_serial_console = { #ifdef CONFIG_CPU_S3C2410 static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C2410 UART", .type = TYPE_S3C24XX, .port_type = PORT_S3C2410, @@ -2644,7 +2644,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { #ifdef CONFIG_CPU_S3C2412 static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C2412 UART", .type = TYPE_S3C24XX, .port_type = PORT_S3C2412, @@ -2674,7 +2674,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2442) static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C2440 UART", .type = TYPE_S3C24XX, .port_type = PORT_S3C2440, @@ -2704,7 +2704,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C6400 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, @@ -2733,7 +2733,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { #ifdef CONFIG_CPU_S5PV210 static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S5PV210 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, @@ -2762,7 +2762,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { #if defined(CONFIG_ARCH_EXYNOS) #define EXYNOS_COMMON_SERIAL_DRV_DATA() \ - .info = &(struct s3c24xx_uart_info) { \ + .info = { \ .name = "Samsung Exynos UART", \ .type = TYPE_S3C6400, \ .port_type = PORT_S3C6400, \ @@ -2811,7 +2811,7 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { #ifdef CONFIG_ARCH_APPLE static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, .port_type = PORT_8250, From patchwork Mon Mar 7 08:09:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771339 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 48AA2C433EF for ; Mon, 7 Mar 2022 08:10:58 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gsQAZcPijwGA98epAba63qO9oHRh9gYqlwU66gXvmv8=; b=uvsuxM4T7Bca3b bhgcv4yLuFvCg85Iz1ooitZ/wJ5fAbcXfu3UaCC0WVerTuk62VhyFTP0P1STkeAcymFwuRxpLAfCz dAVk4ddtsHpLVJ3CQeQ2x0uF1e1QdOTGLOykPUW8WeQYGPFBCo/fdyShmNhWrjxsITkKqaj57kN0a 0sbaX+fqHyEPaOZmRp9Znjy7xZZ0xA5nUD6VAoUoeKJgPGMriBA+DqvwToBbdYmMiCCOxYZWPoIZ7 9pn81HTBtVxQN473YWaroDt1KQMcC75Z++Vo5T6CMJFQny6dnjXHF3mD89pN+mSUmUsJobz0tX/X/ yuZUaYGcIx5xBDnCKCmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qv-00GOWD-Vj; Mon, 07 Mar 2022 08:09:34 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qr-00GOUt-E5 for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:30 +0000 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 3F7BA3F4C2 for ; Mon, 7 Mar 2022 08:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640568; bh=Hr6l7tR8wCFPpDLdPVRbiwm0w/8EJx3zWKyr1VFg4Q4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VFDZZetJDBZau1NmMUCvSxLHT0eviZWktWgjEPXu0LN6trKjHRXBNM9FuYPyeJ+4h WoVazzxc9u6838sLO84mUe4mu3WYLjiFYtOBYP711MyGqlBl8ByGpmZfvjmKzm68Oh 9AnKd6fPKY71puJSnDtDfSijkWZDTgLRhKSy/jnWu7My25YdoM8lRtbw0MCo/2Df+Y b7ffC07nhDjeRkXeGcT6fgM0niQKvR4EEAsmG7NL+/qTms5Cd2/6mdNo0gyf7mAERb +4U7YT0Mz+Rtb3StZq019z9UznjEP/IhjNoBOvIZPpsOpZREDHb/SV0wBbUpy5DX43 VZEwGvV93jp2A== Received: by mail-ed1-f71.google.com with SMTP id y10-20020a056402358a00b00410deddea4cso8155477edc.16 for ; Mon, 07 Mar 2022 00:09:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hr6l7tR8wCFPpDLdPVRbiwm0w/8EJx3zWKyr1VFg4Q4=; b=GAhevvrguvJZwRRpIxws7n82nrIFKI1uHMFyDLWs628S14t+TE1/IGbcGokQn0DLJa bCWI8kOBTw9BUKpdaiXWFHTXMQXk8SgL6ski5QrsbFRNfQn4MFpbd4uqwGP4rxvVloA8 sxxGJbQcDpARI3/s0ApGHla59+CIvbyyEtRAIHuSCe5roMyXlvfHqAILYcUnHat6Sh8M ARfsDCDGQQv210SHLr4PhlD/arpz7apykyrOWza2dEaZVJwGwbXvQPRAv8cg8e6643S4 6PHwuBbr/d6aYjZaymYQo88RCRbfI3rOVeuyKpBUhHoywDvez8uLLPrcUswa1u5/Kt6L Oa4w== X-Gm-Message-State: AOAM5333kv+33yxU3w/upKR514rY8E84suh08GoDylkU/GvBJAuXivXU BmgI8XO2t6Qp4rUnDfbY4Y/Mm6/q7zMlMvLVAh277KbOmnCS/rw5yUwE/46XANblPT01WyEAlSI buYVkUpmer1E9WbMepotKwvvjv5llUU34zMv4U0jkR4D590pjT0GL X-Received: by 2002:aa7:db07:0:b0:415:d33e:a8ea with SMTP id t7-20020aa7db07000000b00415d33ea8eamr9897828eds.342.1646640567896; Mon, 07 Mar 2022 00:09:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNaH7lGnyROX1lQxu8WqlZ1+w74vQK+Ouvk0dc1jxOnopJEO9Ambl+7Snfxcdo3gz4WsL+eg== X-Received: by 2002:aa7:db07:0:b0:415:d33e:a8ea with SMTP id t7-20020aa7db07000000b00415d33ea8eamr9897806eds.342.1646640567675; Mon, 07 Mar 2022 00:09:27 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:27 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/7] tty: serial: samsung: embed s3c2410_uartcfg in parent structure Date: Mon, 7 Mar 2022 09:09:20 +0100 Message-Id: <20220307080925.54131-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000929_635058_5AC88A4C X-CRM114-Status: GOOD ( 16.34 ) 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 Embed "struct s3c2410_uartcfg" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "s3c2410_uartcfg s3c24xx_serial_drv_data") and saves one pointer. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby --- drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index aa5678d03704..a9a75b5b9705 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -86,7 +86,7 @@ struct s3c24xx_uart_info { struct s3c24xx_serial_drv_data { struct s3c24xx_uart_info info; - struct s3c2410_uartcfg *def_cfg; + struct s3c2410_uartcfg def_cfg; unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; }; @@ -2200,7 +2200,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) ourport->info = &ourport->drv_data->info; ourport->cfg = (dev_get_platdata(&pdev->dev)) ? dev_get_platdata(&pdev->dev) : - ourport->drv_data->def_cfg; + &ourport->drv_data->def_cfg; switch (ourport->info->type) { case TYPE_S3C24XX: @@ -2632,7 +2632,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .clksel_mask = S3C2410_UCON_CLKMASK, .clksel_shift = S3C2410_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2661,7 +2661,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .clksel_mask = S3C2412_UCON_CLKMASK, .clksel_shift = S3C2412_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2692,7 +2692,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .clksel_shift = S3C2412_UCON_CLKSHIFT, .ucon_mask = S3C2440_UCON0_DIVMASK, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2721,7 +2721,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .clksel_mask = S3C6400_UCON_CLKMASK, .clksel_shift = S3C6400_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2749,7 +2749,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .clksel_mask = S5PV210_UCON_CLKMASK, .clksel_shift = S5PV210_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S5PV210_UCON_DEFAULT, .ufcon = S5PV210_UFCON_DEFAULT, }, @@ -2778,7 +2778,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .clksel_mask = 0, \ .clksel_shift = 0, \ }, \ - .def_cfg = &(struct s3c2410_uartcfg) { \ + .def_cfg = { \ .ucon = S5PV210_UCON_DEFAULT, \ .ufcon = S5PV210_UFCON_DEFAULT, \ .has_fracval = 1, \ @@ -2827,7 +2827,7 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .clksel_mask = 0, .clksel_shift = 0, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = APPLE_S5L_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, From patchwork Mon Mar 7 08:09:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771340 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 40A59C433EF for ; Mon, 7 Mar 2022 08:11:22 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9cnl1ld4lOVKdM5+HPUYKHfwtw9jvIlmhDs5B60g81M=; b=NmV8D/xlYbEHtn PJTl/8l8qwWsrSJKVgIPcr3C7Bjm/XA4Osr1biS+tsA0MbnSBS6cwZmhn3E8s6PWQWwvYKtVjFL4t ovUgAHOFgJ2VtvrqlE3IKv2/aiZNFWrnimUm22U+h9lt2P67tcLkQ2XrfOHtJbw/hyTprDhfVq8qy ca1g7N571hwe6/L6XPLLT81Q6R79y7u2dH+OOdV+K62+0GLaKFkOmPfZbpWtgpKGqEh6dPmW+7PZu YQiyRzJaYJw6W5Rve7+5/BeBT8JBdLbd4tXHntyGQAODH5drByLF8O6/IqBC7JvLUPvSZRmh4yu+8 j/B9/L1dUmBhVYtHYxSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8RD-00GOdi-6f; Mon, 07 Mar 2022 08:09:51 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qv-00GOVr-DA for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:36 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D558D3F605 for ; Mon, 7 Mar 2022 08:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640570; bh=VfU6rg+3m76TXZN+oNBMBb/R38BcJuX1TlC4U+bbsI8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rD8aIJ4uQjBX6hzUZukA3zW7qOtwbcSExm+BFbCz1ljmk5MLwhSpIs/OTt5aZi780 tmJwNWWBhqTe7nD3Vu/Go0GzRwiSqxYchN7ij5NviQyRKnqIMjkRB597ud8c7W5C3Y PrdNL50kSvFLiAMEHovc/lz0Yzkw18G/LUZbHfqvtAnuzFzLndSa0m52ZKbZwpVEOz nFKm4lbYRwECYNzhAQEALD1EGbD9OMqsrMH7nN6RoZaqz+mZ4S9dog1GOdPS9Jp0GJ KO/IFpFv0p9QVcjlkuQqCkhKhb4bcrRYqPQ+1Lr7mD4J1pDi9s4u/P8yP+UoChjd9F BXxMv0/mwZ/kQ== Received: by mail-ej1-f72.google.com with SMTP id hq34-20020a1709073f2200b006d677c94909so6635404ejc.8 for ; Mon, 07 Mar 2022 00:09:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VfU6rg+3m76TXZN+oNBMBb/R38BcJuX1TlC4U+bbsI8=; b=Wnj2kml60bwKeWf8izxSAidXduqcGhIeeQTeETK8GTqk8YjpbWfGt27sBM0IHcsRxu Jyb0nny34BYLnaPeHEqcow8Z6dbdAPT7QXG6bJVOmjLP2himWHQ9BM4WiutltiADO7CG j09Cr5fNA2frbsK6XfZuueMHIWPno+PzCQXKtaDuhXGUqI/G5iNqto/BMOSPE7xyVHcT JK3n9efuZ9yMCZ/H1VsHtNTiLifMMSN6IzV5S5VudigrY4dw+8AWUNFf/E/bXtSOWI51 Y7A5bacjH1MRWV6w4y3snSOROx4PyGXBO2tHmIYYAQRoTyPvoWDu8KA3wNHzhiuD4RyG 2oDg== X-Gm-Message-State: AOAM531pJ6wU8/QJ4NROibjOff3BoufctR6C0SEaBh58NBo00uhP5U3C ikUpZXHYQVgAXFXBYiGNk9fShoLrpn8g26ZU0bfrHyuo8TsvtKgKwCl4+YKawqL3b8iCo0KB/j6 KcV3ihmPJ6YlvJh6FT0VxB0QzRx5E7PFQ8Jy/1S2iJ/ijz1ZMm9tI X-Received: by 2002:a17:907:72c1:b0:6da:b844:3dd5 with SMTP id du1-20020a17090772c100b006dab8443dd5mr7985787ejc.244.1646640569353; Mon, 07 Mar 2022 00:09:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtdFZvbk0wQoNXUaQolDmbS4d6fdrpe2cdRnUdGyElVakkLE9BktRO7Vin4U5+6zELPrlTNw== X-Received: by 2002:a17:907:72c1:b0:6da:b844:3dd5 with SMTP id du1-20020a17090772c100b006dab8443dd5mr7985775ejc.244.1646640569089; Mon, 07 Mar 2022 00:09:29 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:28 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/7] tty: serial: samsung: constify s3c24xx_serial_drv_data Date: Mon, 7 Mar 2022 09:09:21 +0100 Message-Id: <20220307080925.54131-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000933_784394_EE4D3C61 X-CRM114-Status: GOOD ( 21.98 ) 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 The driver data (struct s3c24xx_serial_drv_data) is only used to initialize the driver properly and is not modified. Make it const. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 130 +++++++++++++++---------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index a9a75b5b9705..c4b13f2d6e26 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -136,14 +136,14 @@ struct s3c24xx_uart_port { unsigned int tx_mode; unsigned int rx_mode; - struct s3c24xx_uart_info *info; + const struct s3c24xx_uart_info *info; struct clk *clk; struct clk *baudclk; struct uart_port port; - struct s3c24xx_serial_drv_data *drv_data; + const struct s3c24xx_serial_drv_data *drv_data; /* reference to platform data */ - struct s3c2410_uartcfg *cfg; + const struct s3c2410_uartcfg *cfg; struct s3c24xx_uart_dma *dma; @@ -221,7 +221,7 @@ static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, local_irq_restore(flags); } -static inline struct s3c24xx_uart_port *to_ourport(struct uart_port *port) +static inline struct s3c24xx_uart_port *to_ourport(const struct uart_port *port) { return container_of(port, struct s3c24xx_uart_port, port); } @@ -573,13 +573,13 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port) } } -static inline struct s3c24xx_uart_info +static inline const struct s3c24xx_uart_info *s3c24xx_port_to_info(struct uart_port *port) { return to_ourport(port)->info; } -static inline struct s3c2410_uartcfg +static inline const struct s3c2410_uartcfg *s3c24xx_port_to_cfg(struct uart_port *port) { struct s3c24xx_uart_port *ourport; @@ -594,7 +594,7 @@ static inline struct s3c2410_uartcfg static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport, unsigned long ufstat) { - struct s3c24xx_uart_info *info = ourport->info; + const struct s3c24xx_uart_info *info = ourport->info; if (ufstat & info->rx_fifofull) return ourport->port.fifosize; @@ -986,7 +986,7 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id) static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ufstat = rd_regl(port, S3C2410_UFSTAT); unsigned long ufcon = rd_regl(port, S3C2410_UFCON); @@ -1405,7 +1405,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, static inline int s3c24xx_serial_getsource(struct uart_port *port) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned int ucon; if (info->num_clks == 1) @@ -1419,7 +1419,7 @@ static inline int s3c24xx_serial_getsource(struct uart_port *port) static void s3c24xx_serial_setsource(struct uart_port *port, unsigned int clk_sel) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned int ucon; if (info->num_clks == 1) @@ -1438,7 +1438,7 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, unsigned int req_baud, struct clk **best_clk, unsigned int *clk_num) { - struct s3c24xx_uart_info *info = ourport->info; + const struct s3c24xx_uart_info *info = ourport->info; struct clk *clk; unsigned long rate; unsigned int cnt, baud, quot, best_quot = 0; @@ -1522,7 +1522,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old) { - struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); + const struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); struct s3c24xx_uart_port *ourport = to_ourport(port); struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; @@ -1691,7 +1691,7 @@ static const char *s3c24xx_serial_type(struct uart_port *port) static void s3c24xx_serial_config_port(struct uart_port *port, int flags) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); if (flags & UART_CONFIG_TYPE) port->type = info->port_type; @@ -1703,7 +1703,7 @@ static void s3c24xx_serial_config_port(struct uart_port *port, int flags) static int s3c24xx_serial_verify_port(struct uart_port *port, struct serial_struct *ser) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); if (ser->type != PORT_UNKNOWN && ser->type != info->port_type) return -EINVAL; @@ -1873,9 +1873,9 @@ s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = { */ static void s3c24xx_serial_resetport(struct uart_port *port, - struct s3c2410_uartcfg *cfg) + const struct s3c2410_uartcfg *cfg) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ucon = rd_regl(port, S3C2410_UCON); ucon &= (info->clksel_mask | info->ucon_mask); @@ -1979,7 +1979,7 @@ s3c24xx_serial_cpufreq_deregister(struct s3c24xx_uart_port *port) static int s3c24xx_serial_enable_baudclk(struct s3c24xx_uart_port *ourport) { struct device *dev = ourport->port.dev; - struct s3c24xx_uart_info *info = ourport->info; + const struct s3c24xx_uart_info *info = ourport->info; char clk_name[MAX_CLK_NAME_LENGTH]; unsigned int clk_sel; struct clk *clk; @@ -2021,7 +2021,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, struct platform_device *platdev) { struct uart_port *port = &ourport->port; - struct s3c2410_uartcfg *cfg = ourport->cfg; + const struct s3c2410_uartcfg *cfg = ourport->cfg; struct resource *res; int ret; @@ -2156,7 +2156,7 @@ static const struct of_device_id s3c24xx_uart_dt_match[]; static int probe_index; -static inline struct s3c24xx_serial_drv_data * +static inline const struct s3c24xx_serial_drv_data * s3c24xx_get_driver_data(struct platform_device *pdev) { #ifdef CONFIG_OF @@ -2419,7 +2419,7 @@ static struct uart_port *cons_uart; static int s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ufstat, utrstat; if (ufcon & S3C2410_UFCON_FIFOMODE) { @@ -2615,7 +2615,7 @@ static struct console s3c24xx_serial_console = { #endif /* CONFIG_SERIAL_SAMSUNG_CONSOLE */ #ifdef CONFIG_CPU_S3C2410 -static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .info = { .name = "Samsung S3C2410 UART", .type = TYPE_S3C24XX, @@ -2637,13 +2637,13 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C2410_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2410_serial_drv_data) +#define S3C2410_SERIAL_DRV_DATA (&s3c2410_serial_drv_data) #else -#define S3C2410_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C2410_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_CPU_S3C2412 -static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .info = { .name = "Samsung S3C2412 UART", .type = TYPE_S3C24XX, @@ -2666,14 +2666,14 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C2412_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2412_serial_drv_data) +#define S3C2412_SERIAL_DRV_DATA (&s3c2412_serial_drv_data) #else -#define S3C2412_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C2412_SERIAL_DRV_DATA NULL #endif #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2442) -static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .info = { .name = "Samsung S3C2440 UART", .type = TYPE_S3C24XX, @@ -2697,13 +2697,13 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C2440_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2440_serial_drv_data) +#define S3C2440_SERIAL_DRV_DATA (&s3c2440_serial_drv_data) #else -#define S3C2440_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C2440_SERIAL_DRV_DATA NULL #endif #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) -static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .info = { .name = "Samsung S3C6400 UART", .type = TYPE_S3C6400, @@ -2726,13 +2726,13 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C6400_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c6400_serial_drv_data) +#define S3C6400_SERIAL_DRV_DATA (&s3c6400_serial_drv_data) #else -#define S3C6400_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C6400_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_CPU_S5PV210 -static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .info = { .name = "Samsung S5PV210 UART", .type = TYPE_S3C6400, @@ -2755,9 +2755,9 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { }, .fifosize = { 256, 64, 16, 16 }, }; -#define S5PV210_SERIAL_DRV_DATA ((kernel_ulong_t)&s5pv210_serial_drv_data) +#define S5PV210_SERIAL_DRV_DATA (&s5pv210_serial_drv_data) #else -#define S5PV210_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S5PV210_SERIAL_DRV_DATA NULL #endif #if defined(CONFIG_ARCH_EXYNOS) @@ -2784,33 +2784,33 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .has_fracval = 1, \ } \ -static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { +static const struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { EXYNOS_COMMON_SERIAL_DRV_DATA(), .fifosize = { 256, 64, 16, 16 }, }; -static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = { +static const struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = { EXYNOS_COMMON_SERIAL_DRV_DATA(), .fifosize = { 64, 256, 16, 256 }, }; -static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { +static const struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { EXYNOS_COMMON_SERIAL_DRV_DATA(), .fifosize = { 256, 64, 64, 64 }, }; -#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) -#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos5433_serial_drv_data) -#define EXYNOS850_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos850_serial_drv_data) +#define EXYNOS4210_SERIAL_DRV_DATA (&exynos4210_serial_drv_data) +#define EXYNOS5433_SERIAL_DRV_DATA (&exynos5433_serial_drv_data) +#define EXYNOS850_SERIAL_DRV_DATA (&exynos850_serial_drv_data) #else -#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) -#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) -#define EXYNOS850_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) +#define EXYNOS4210_SERIAL_DRV_DATA NULL +#define EXYNOS5433_SERIAL_DRV_DATA NULL +#define EXYNOS850_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_ARCH_APPLE -static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .info = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, @@ -2832,39 +2832,39 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)&s5l_serial_drv_data) +#define S5L_SERIAL_DRV_DATA (&s5l_serial_drv_data) #else -#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) +#define S5L_SERIAL_DRV_DATA NULL #endif static const struct platform_device_id s3c24xx_serial_driver_ids[] = { { .name = "s3c2410-uart", - .driver_data = S3C2410_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C2410_SERIAL_DRV_DATA, }, { .name = "s3c2412-uart", - .driver_data = S3C2412_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C2412_SERIAL_DRV_DATA, }, { .name = "s3c2440-uart", - .driver_data = S3C2440_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C2440_SERIAL_DRV_DATA, }, { .name = "s3c6400-uart", - .driver_data = S3C6400_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C6400_SERIAL_DRV_DATA, }, { .name = "s5pv210-uart", - .driver_data = S5PV210_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S5PV210_SERIAL_DRV_DATA, }, { .name = "exynos4210-uart", - .driver_data = EXYNOS4210_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)EXYNOS4210_SERIAL_DRV_DATA, }, { .name = "exynos5433-uart", - .driver_data = EXYNOS5433_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)EXYNOS5433_SERIAL_DRV_DATA, }, { .name = "s5l-uart", - .driver_data = S5L_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S5L_SERIAL_DRV_DATA, }, { .name = "exynos850-uart", - .driver_data = EXYNOS850_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)EXYNOS850_SERIAL_DRV_DATA, }, { }, }; @@ -2873,23 +2873,23 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids); #ifdef CONFIG_OF static const struct of_device_id s3c24xx_uart_dt_match[] = { { .compatible = "samsung,s3c2410-uart", - .data = (void *)S3C2410_SERIAL_DRV_DATA }, + .data = S3C2410_SERIAL_DRV_DATA }, { .compatible = "samsung,s3c2412-uart", - .data = (void *)S3C2412_SERIAL_DRV_DATA }, + .data = S3C2412_SERIAL_DRV_DATA }, { .compatible = "samsung,s3c2440-uart", - .data = (void *)S3C2440_SERIAL_DRV_DATA }, + .data = S3C2440_SERIAL_DRV_DATA }, { .compatible = "samsung,s3c6400-uart", - .data = (void *)S3C6400_SERIAL_DRV_DATA }, + .data = S3C6400_SERIAL_DRV_DATA }, { .compatible = "samsung,s5pv210-uart", - .data = (void *)S5PV210_SERIAL_DRV_DATA }, + .data = S5PV210_SERIAL_DRV_DATA }, { .compatible = "samsung,exynos4210-uart", - .data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, + .data = EXYNOS4210_SERIAL_DRV_DATA }, { .compatible = "samsung,exynos5433-uart", - .data = (void *)EXYNOS5433_SERIAL_DRV_DATA }, + .data = EXYNOS5433_SERIAL_DRV_DATA }, { .compatible = "apple,s5l-uart", - .data = (void *)S5L_SERIAL_DRV_DATA }, + .data = S5L_SERIAL_DRV_DATA }, { .compatible = "samsung,exynos850-uart", - .data = (void *)EXYNOS850_SERIAL_DRV_DATA }, + .data = EXYNOS850_SERIAL_DRV_DATA }, {}, }; MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); From patchwork Mon Mar 7 08:09:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771341 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B0737C433EF for ; Mon, 7 Mar 2022 08:11:33 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5AOeV89eXA43AcGIPDo8ZDHpdpybxYTPBM4hoGnMji4=; b=Jm5+UHJVeAqM7T CU47SZn9NzM/Q4TpHLC2aPEsfRdkXzV/tXX/187VmAXzmVfDnTV7mIA+VSX0lgXnjiRrR0t5ObGVZ tStYHZCbgmMcsFBDe0OTTz5PyFigVcUYNOJ4+kxiCK/SoOWO0TiEDzioX33uAIh8D0idvJpv1pQLF lljJdVfq3M2kdPopTSPB3CYCg3WVNrv6F9tW56l0gcOG7xzJerz7w4/waveggg5FddD/KQOuJogns OvGP0iil11DaVCRl+iRmRhdtEHkXaSnMwgvGj4MQ8eURcwXAWEGHMAdeuc26Dxn/gpkB8lxw+Fqgg 3IYuMzJByCAyeO6+Zl1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8RS-00GOmG-76; Mon, 07 Mar 2022 08:10:06 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qx-00GOWk-2G for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:37 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 5B3073F60B for ; Mon, 7 Mar 2022 08:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640573; bh=4HAGUFdmLrEMxU9EFzkJe4Ux3HcmnFK/yDcsBQCmOjM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e1AUiT7qakrbezj64vxttoVNwYMCdWU3ly9Nd2DI5BPjvLHZrgZtmASbVy60aywZP 3FGc6mbv1esEpSPaoW/gAr3418SntY/mvnmbUh3/kQGnSk7mSM8m/mUtWL5DxE9XUO SrsdPBOsGW4knPH3aA831USgCfjRIg7/txa7ZPs+iDCMH1ZgA+fJ/0gMllOgyMwfBe CBQUKgdByTZQwMkOH1UekB6rUt7hsGrcydUaNQ7CgqHE2Q9cINYtbL+AO8OYKdakgO gRBT5mvhp71oNEP1ZQPJikEB9rOLJUTtQnCMHW/8mpwy2ZkJyC46HDASE+AbxCPLg8 rriHFvGM2ZM/g== Received: by mail-ed1-f72.google.com with SMTP id l24-20020a056402231800b00410f19a3103so8158425eda.5 for ; Mon, 07 Mar 2022 00:09:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4HAGUFdmLrEMxU9EFzkJe4Ux3HcmnFK/yDcsBQCmOjM=; b=RWNn8AfKhHdNNeLGZquk0Cw37XeQYk3v0znUeSDIQ4rQBjMcaK//GrAqHgxG2EBsZ5 hBgO1duNTMTDV4CwpvgSPgX3SYosP2U7AMQSJiJ0V48u5Yj4JmTJq9tq08IaPEvhVdmy /O2WlyQ2jH/jQSmZKkWhr9LQoixapPCqJvu3Tg31EzWgHFIMIf2Zi08qhcSxEoydcjuR /ms6oBnVq69N0h6QdQJB4sdPUWijPnR+duX8cpzGHV1IjUtGZ/l4B/ESBJ6qThkp1TLO Dui31/Yi4Y/Wjf1Mnq/FchNVBvvczxLlwS37AusT7+lwxhpPdUMiwmOEDutl0UFylQok 1PqQ== X-Gm-Message-State: AOAM533COsn6tguDHCogORXDeyo7Lh0Wdp1OcJrYq/U8pEx1clM/wDiS p6pCqwbcKAId0aOqIxCwgt1d+dSSCo0N9aBpCluA6oYYYnlKGOByV5dgd2pY+jWqTr+9yuBN7c4 XgiRQSsRrxZIb28FiippREkTcNle0lQl7uno5tj/6arOoRKd1oy3p X-Received: by 2002:a05:6402:18:b0:410:86cd:9dce with SMTP id d24-20020a056402001800b0041086cd9dcemr9810254edu.70.1646640570856; Mon, 07 Mar 2022 00:09:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgU+c7KFSylijaRWQXv0cNRe/wpPkgSFLwallIr6sdnzfiO44fulIE699j1F9ifcnE8L0KOA== X-Received: by 2002:a05:6402:18:b0:410:86cd:9dce with SMTP id d24-20020a056402001800b0041086cd9dcemr9810243edu.70.1646640570665; Mon, 07 Mar 2022 00:09:30 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:29 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/7] tty: serial: samsung: constify UART name Date: Mon, 7 Mar 2022 09:09:22 +0100 Message-Id: <20220307080925.54131-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000935_276571_E7385C99 X-CRM114-Status: GOOD ( 13.84 ) 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 The UART name from driver data holds only string literals. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index c4b13f2d6e26..7025306f76b7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -63,7 +63,7 @@ enum s3c24xx_port_type { }; struct s3c24xx_uart_info { - char *name; + const char *name; enum s3c24xx_port_type type; unsigned int port_type; unsigned int fifosize; From patchwork Mon Mar 7 08:09:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771342 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5D5DC433F5 for ; Mon, 7 Mar 2022 08:11:44 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OYTXEerhoXn4c8J4iyEP1eSO6XkKd5NTqPm6DMx4MoE=; b=ih702ZhIOAmHkN u7eRkJZfKTGDL42AmVBskOkkpyT9y7Kjpn1MzMa+QSdGr7HzBqbN2gM2bSpwmOmJf+wIMCuXw5HK7 0GpgCL4jfbVc38MIZkEaMIc8RtW4Wm3nneeSrcY+cDTRpQPfLQqUAEnzLn7n7a4vdHmy/HBMo3lvR /7G7XrEcR+qJcWjzc/tq0PbwuUacIpePFsRTUrF62m+cq5e5pp9w0VoGpmYbGsMaY0Z/ZeYdtjmUo /SI+gNXq0F9DW1QubPMim7AcV97lb/W9Q1HBDo7hPQLZUpfPcp2eOWO5GQOccLJE8AWIl+jAXLqyP UG9TLuKtNKBJqSXHo4WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Rg-00GOsU-PX; Mon, 07 Mar 2022 08:10:20 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qx-00GOWr-2K for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:38 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D1CC83F625 for ; Mon, 7 Mar 2022 08:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640573; bh=kV9bWky3aqex0YOWejd45KPzqFNsCZcNjbYJT0yjx5k=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RQphjHQJmXBAx8OeYX3OY6E4zyOjEy4PMuiTtFe9MtP6VCgrOaAkK0apjKxRO7F7m K7BmT9MdmXicq9yhv0zszOqSmESNTkEaUonfd3E9yTFDBO/wwWnLiOuh+uydgdycSl IWYvNCP/ksnjlqLXFz6hipklyLKAr1QAXGOom/GhpbS1yzdShup3re0/4i9epK7snC eHZ0slxKAOjPmYX0xj8aqJ2Op8sEtILpBkxkDcqy5Ie8qBz7qD2cWaGH66e3/hi4I5 40jzuA0yuQIucLROu97t2utbpOIUpMrWrogbQhua8zJG5Q9MdGN56JkpKvpN5eCIIO TQa0rPmVzbDUQ== Received: by mail-ej1-f69.google.com with SMTP id h22-20020a1709060f5600b006b11a2d3dcfso6611608ejj.4 for ; Mon, 07 Mar 2022 00:09:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kV9bWky3aqex0YOWejd45KPzqFNsCZcNjbYJT0yjx5k=; b=oMQEY1HcTDQKEX7Jjmkw3EnIWx8OpmHDlPAoaEZYIvCQudzdn2rVY1unCf2jVxJ54i R+RisjQeymrUgFurgJwVs6Hqdfoa+KlBr7sUQhSif7t0q2rPYR8f1gfp/NukZgnm4S9K dm5qDhXZ0iG6osMuVoB/CRujl6t+BF1ELI1beOpa6M83cTbnIFweJ+u1ehiDqxy0DNqi tm7Nutcb3tzhA6ufLY/xybD7B/TYlNZTeNU29meaRdEdbqIg5H+bBEyqCU0QZNi5L2Ky y64RfEfBMDJQDMI9gHRBoDtjuq9SDZQKlb6lA26aWJs5FfvecjHM++19uflFQaTuOGNU CJOg== X-Gm-Message-State: AOAM53201tgpNmB52g3Njxk/39NK6HRYYAggWt0T8Sykj+Kv8/gJ5MA0 xVrQURCUsIpgWOyuRufKn3ebD9JfMnX9GjExCDfCVwKZxsKyHjmj1J3kg7wQbOK94BriD+XiJNH K3zVLtBL1+Tsy1OTP6xA4T5e2q6vxU2dTaAp+2uDbvT9wTWbZtL6e X-Received: by 2002:a17:907:9956:b0:6cf:cd25:c5a7 with SMTP id kl22-20020a170907995600b006cfcd25c5a7mr7978726ejc.635.1646640572157; Mon, 07 Mar 2022 00:09:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwu85jkg65tIPk5L9NKONVRpMHiBi3IKZigN9L3D0ZJ8f0joA64x28uwWQqTpa7qj5dJKGMqw== X-Received: by 2002:a17:907:9956:b0:6cf:cd25:c5a7 with SMTP id kl22-20020a170907995600b006cfcd25c5a7mr7978714ejc.635.1646640572014; Mon, 07 Mar 2022 00:09:32 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:31 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] tty: serial: samsung: constify s3c24xx_serial_drv_data members Date: Mon, 7 Mar 2022 09:09:23 +0100 Message-Id: <20220307080925.54131-4-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000935_297345_091BE99B X-CRM114-Status: GOOD ( 14.07 ) 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 The driver data (struct s3c24xx_serial_drv_data) is never modified, so also its members can be made const. Except code style this has no impact because the structure itself is always a const. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby --- drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 7025306f76b7..b9783d8fb440 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -85,9 +85,9 @@ struct s3c24xx_uart_info { }; struct s3c24xx_serial_drv_data { - struct s3c24xx_uart_info info; - struct s3c2410_uartcfg def_cfg; - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; + const struct s3c24xx_uart_info info; + const struct s3c2410_uartcfg def_cfg; + const unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; }; struct s3c24xx_uart_dma { From patchwork Mon Mar 7 08:09:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771344 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E258EC433F5 for ; Mon, 7 Mar 2022 08:12:50 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DvycgddICVX78RzIHw3pEiTdDN3JaqsJO43b/Of1mLA=; b=j3vdIUqQMt6je+ RqKm75gT3qqUV23u/4i7XKsD6hRnWxNqtFdqpd/Mv6MubfyC6DHzDbzyiBQeJP+ps6Cw6Nluo8rJ9 61pdA8Ppf7Mt8OvOn2tdqliEQtmlFCm4x5hrERvEdi2m0KiFE14Lk8lMtUXOPtYFcdQ0ou96FgRxi xDZ+tuCED4+gQB5rKP7EWgWeEvYgoQiQXsNtFF9uYp5QnkGhevsZGQe38FeB6nLX6oKMxJKXxABVb IdGmM8SKOkWcbykzTohSUd29IhfXeAExq3tNqyIQ6H7kEY2pbchIhqu/tWxZxzW5/Mkdgq02EfOXw WtKERRBWRRRfD4jNuVXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Sh-00GPMO-No; Mon, 07 Mar 2022 08:11:24 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qz-00GOXn-01 for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:39 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A56333F4C2 for ; Mon, 7 Mar 2022 08:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640574; bh=h6f9aBRuD6q6vAjPoDeH1HVvyeu4tZHUHi6lgSytsOc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GHUm6EZwNhvNRuXBVYSgyEUpitDEdD2q2eDjjVfnriF+er10b/ICWsg5sXe1z2/Lv IpigH8XQZwR8DA5QfPWBziAt9LIAjZqIStyloUw5RyNUf7Udax3hM5vEZMeUCh0LaS SkpNBfToB5jj+3nr9576yK7glQAufAtz89fDTzukahaciQSk/PH79h+LWV6VAELgiQ XUlcEPvt1ZzKr9hpL5P5hVm1t43aO2OxSTRDjx6Zs7zr0D/sTk3NBqefAqs2AmOBPv WPbGy/y4IkDvuKWKuFh81tQ3Fb14aQw8YcWpDkJES1k2so28zJRZML3fPxJ+1TsLUS 8TcPxn3XrVK7Q== Received: by mail-ej1-f72.google.com with SMTP id nb1-20020a1709071c8100b006d03c250b6fso6610597ejc.11 for ; Mon, 07 Mar 2022 00:09:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h6f9aBRuD6q6vAjPoDeH1HVvyeu4tZHUHi6lgSytsOc=; b=jFijpJUsfUwpsCJPypJSQ8mEQN8eRlZdSrNzJtlYcGauLZAIvxBS1Mf3ITbaQNQByS 52DPMZcOZU6RdcHmJmG2Ldj8LJwUHAcZ9IPQ80Ws0YR/HoanU9BvqwMYr9pebfDbraN+ n4djrkhJbWffL0WYz5DIAJaN0NZzCo9XpV/9J0L2hJgDQYGIv13N6KFTd9tU++10ulw4 PD5NcDRgNZWCaGgYCr9C8RHJhRbZnRcZinwlvSoTgYuT1Jm1LtI0qcKWHwbX6TqxZTfe YVb4OMyeEYTRYORWdM5CPd+E6E1OqoikJStoUn80HovexuqX/X09RjURs+vOIiR4bwUT CeEQ== X-Gm-Message-State: AOAM531LH2lPXAT2Oa1yP8p729xzeq6CeiR41Ohs4bMnwGUwprW4LHFD yVrqn4E/X4EolIxS0lb4i/J4k2SlrUBvA7S2jLPGvEyPkc6aoX0DjyRz4pCibD/Ay7a5FxVtIqz uwFvaV0VQ4U0U7DAoY8pqJ/Z3W0Kzh5zmJ/D9v1ZwSOtJiRWAW77m X-Received: by 2002:a17:906:1158:b0:6d0:562b:d8ee with SMTP id i24-20020a170906115800b006d0562bd8eemr8318849eja.78.1646640573844; Mon, 07 Mar 2022 00:09:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJFERfDAzIzSbz/jjP+nZrQWV1hE6APZaomrEaakxaIYDNfhbNIVLeDnfdSIfagKkLTgaiSg== X-Received: by 2002:a17:906:1158:b0:6d0:562b:d8ee with SMTP id i24-20020a170906115800b006d0562bd8eemr8318840eja.78.1646640573600; Mon, 07 Mar 2022 00:09:33 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:32 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] tty: serial: samsung: constify variables and pointers Date: Mon, 7 Mar 2022 09:09:24 +0100 Message-Id: <20220307080925.54131-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000937_242757_11B25992 X-CRM114-Status: GOOD ( 18.27 ) 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 Constify variables, data pointed by several pointers and "udivslot_table" static array. This makes code a bit safer. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby --- drivers/tty/serial/samsung_tty.c | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b9783d8fb440..3ffae912217c 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -164,7 +164,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport); #define portaddrl(port, reg) \ ((unsigned long *)(unsigned long)((port)->membase + (reg))) -static u32 rd_reg(struct uart_port *port, u32 reg) +static u32 rd_reg(const struct uart_port *port, u32 reg) { switch (port->iotype) { case UPIO_MEM: @@ -179,7 +179,7 @@ static u32 rd_reg(struct uart_port *port, u32 reg) #define rd_regl(port, reg) (readl_relaxed(portaddr(port, reg))) -static void wr_reg(struct uart_port *port, u32 reg, u32 val) +static void wr_reg(const struct uart_port *port, u32 reg, u32 val) { switch (port->iotype) { case UPIO_MEM: @@ -195,7 +195,7 @@ static void wr_reg(struct uart_port *port, u32 reg, u32 val) /* Byte-order aware bit setting/clearing functions. */ -static inline void s3c24xx_set_bit(struct uart_port *port, int idx, +static inline void s3c24xx_set_bit(const struct uart_port *port, int idx, unsigned int reg) { unsigned long flags; @@ -208,7 +208,7 @@ static inline void s3c24xx_set_bit(struct uart_port *port, int idx, local_irq_restore(flags); } -static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, +static inline void s3c24xx_clear_bit(const struct uart_port *port, int idx, unsigned int reg) { unsigned long flags; @@ -221,19 +221,19 @@ static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, local_irq_restore(flags); } -static inline struct s3c24xx_uart_port *to_ourport(const struct uart_port *port) +static inline struct s3c24xx_uart_port *to_ourport(struct uart_port *port) { return container_of(port, struct s3c24xx_uart_port, port); } /* translate a port to the device name */ -static inline const char *s3c24xx_serial_portname(struct uart_port *port) +static inline const char *s3c24xx_serial_portname(const struct uart_port *port) { return to_platform_device(port->dev)->name; } -static int s3c24xx_serial_txempty_nofifo(struct uart_port *port) +static int s3c24xx_serial_txempty_nofifo(const struct uart_port *port) { return rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE; } @@ -358,7 +358,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args) static void enable_tx_dma(struct s3c24xx_uart_port *ourport) { - struct uart_port *port = &ourport->port; + const struct uart_port *port = &ourport->port; u32 ucon; /* Mask Tx interrupt */ @@ -387,7 +387,7 @@ static void enable_tx_dma(struct s3c24xx_uart_port *ourport) static void enable_tx_pio(struct s3c24xx_uart_port *ourport) { - struct uart_port *port = &ourport->port; + const struct uart_port *port = &ourport->port; u32 ucon, ufcon; /* Set ufcon txtrig */ @@ -580,9 +580,9 @@ static inline const struct s3c24xx_uart_info } static inline const struct s3c2410_uartcfg - *s3c24xx_port_to_cfg(struct uart_port *port) + *s3c24xx_port_to_cfg(const struct uart_port *port) { - struct s3c24xx_uart_port *ourport; + const struct s3c24xx_uart_port *ourport; if (port->dev == NULL) return NULL; @@ -591,7 +591,7 @@ static inline const struct s3c2410_uartcfg return ourport->cfg; } -static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport, +static int s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, unsigned long ufstat) { const struct s3c24xx_uart_info *info = ourport->info; @@ -947,8 +947,8 @@ static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id) /* interrupt handler for s3c64xx and later SoC's.*/ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id) { - struct s3c24xx_uart_port *ourport = id; - struct uart_port *port = &ourport->port; + const struct s3c24xx_uart_port *ourport = id; + const struct uart_port *port = &ourport->port; unsigned int pend = rd_regl(port, S3C64XX_UINTP); irqreturn_t ret = IRQ_HANDLED; @@ -966,8 +966,8 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id) /* interrupt handler for Apple SoC's.*/ static irqreturn_t apple_serial_handle_irq(int irq, void *id) { - struct s3c24xx_uart_port *ourport = id; - struct uart_port *port = &ourport->port; + const struct s3c24xx_uart_port *ourport = id; + const struct uart_port *port = &ourport->port; unsigned int pend = rd_regl(port, S3C2410_UTRSTAT); irqreturn_t ret = IRQ_NONE; @@ -1499,7 +1499,7 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, * This table takes the fractional value of the baud divisor and gives * the recommended setting for the UDIVSLOT register. */ -static u16 udivslot_table[16] = { +static const u16 udivslot_table[16] = { [0] = 0x0000, [1] = 0x0080, [2] = 0x0808, @@ -1675,7 +1675,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, static const char *s3c24xx_serial_type(struct uart_port *port) { - struct s3c24xx_uart_port *ourport = to_ourport(port); + const struct s3c24xx_uart_port *ourport = to_ourport(port); switch (ourport->info->type) { case TYPE_S3C24XX: @@ -2450,7 +2450,7 @@ s3c24xx_port_configured(unsigned int ucon) static int s3c24xx_serial_get_poll_char(struct uart_port *port) { - struct s3c24xx_uart_port *ourport = to_ourport(port); + const struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned int ufstat; ufstat = rd_regl(port, S3C2410_UFSTAT); @@ -2935,7 +2935,7 @@ module_exit(samsung_serial_exit); * Early console. */ -static void wr_reg_barrier(struct uart_port *port, u32 reg, u32 val) +static void wr_reg_barrier(const struct uart_port *port, u32 reg, u32 val) { switch (port->iotype) { case UPIO_MEM: @@ -2951,15 +2951,15 @@ struct samsung_early_console_data { u32 txfull_mask; }; -static void samsung_early_busyuart(struct uart_port *port) +static void samsung_early_busyuart(const struct uart_port *port) { while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE)) ; } -static void samsung_early_busyuart_fifo(struct uart_port *port) +static void samsung_early_busyuart_fifo(const struct uart_port *port) { - struct samsung_early_console_data *data = port->private_data; + const struct samsung_early_console_data *data = port->private_data; while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask) ; From patchwork Mon Mar 7 08:09:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771343 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D0D9BC433EF for ; Mon, 7 Mar 2022 08:12:21 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HBiKhGvNGKA3fD+4h34awAaOdSx9YsnSFqVYCRgWhtM=; b=UHrG7xJiHPUfob zp5NyQRQ5z04Pc19OX3kyMD8dmPFYcaDOXITlx44blhE3pQGZvQxgZnCrIwKH2753LZq4x1kLTi6V FXmrlK4ExlgQu357EDIFBCDSIOLVnJU53RLlTWCA8B6cfIHrRRcffEKSE5oSkPMNmpKKUuQCpqcCD SANh76u82T0WFRvRHrHI0zMb526llK8bc0s35Vh6b8K/AmNZAzxDcOqiiwgLoky1T/Rto3Fmf4dYA /wfny+TfApNC4KfeK+DwMx2QPcQAdXbso2tMIbbA3HFJ4WwEGVJYvdTGtiNvynfvymNj8ncvpAaqE yFDvTKA2i2LjRdWGbf5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8S9-00GP6l-AS; Mon, 07 Mar 2022 08:10:49 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qz-00GOYJ-Mj for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:39 +0000 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 701323F600 for ; Mon, 7 Mar 2022 08:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640576; bh=qtWe8unaq2gnuH4T5GX8K7Uz0Sk1ucH1nG+ntQuiss8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vCZaSo1HP8djnJ+LH5Lx3pkLoOhvUtkLFtEDhFoQ5cKORlhX/0N0fWBvLTIzq8rgM gPqo6Nbdjd4lABJS06JS61XylDcav1BzryOvPEOjsQD5lA8zVF4NKlC7K2rPdnz4Su mxVC1nKbsKlBTBxU1BS3vuOO1f40y9bMt7mWU7tTf8wJJDSrYIrOQ3fOGQhGoD+8f4 z+caJltrlKf8jXuIbhjETqcC/kNe26g/ao0nqyQD6n0osFVmhxyouHQjOScUs9aWJ+ lbz/ZSusQVGWtv8pDaSCt5G6bevUIo3ZaelC7CSv8JOpQLqTmRcIp8sDQ+AFf2wnJV 0siCYGTsbhWgQ== Received: by mail-ej1-f71.google.com with SMTP id r18-20020a17090609d200b006a6e943d09eso6580981eje.20 for ; Mon, 07 Mar 2022 00:09:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qtWe8unaq2gnuH4T5GX8K7Uz0Sk1ucH1nG+ntQuiss8=; b=3u0em11SOt/byMYbOZ30zItfxr6QLwjSv6OTX6HnMb7+K1kiPTx4YHG/gLNjagajS8 o1mk4YST4FYT8Wz6K8ED+7takAPw3EhXTbinm3jvTUlL5nTN1b8+IJpyuOmG5q0Qa+WR iKPbb2k2CHi0V/AV9lsZuIwUtt3KKV++uEOe3iXKQuvba2fxgJvJdxfHPsFWZAargILu gr0NnT3bCNFvaQEpO6y7MeBl6QrrJgPgyKgPYUFCGLZLG+mljbxIn0PSqCxaInXW2Hj0 UmdFya80NqMa4iD1IfaQSbyjT8mxfD1wZUzeRmDaxp5GFTEmSAesbhOR/oEOnpd/BWF8 c3yw== X-Gm-Message-State: AOAM531rfOus/mFdyXzrTTOqD2zJ8oTF4G9G2MdM2arDvCE+MO9qk2q2 jVs6lmznr/VFaTxYP1yT4na4bBKZ9MFcr8Zyk58twjvKhCoYeUA3flhTMNFEbH2KH17EVcRYgxY 9AwnBb4NIiEG4Jg97iuq0Tj4oS6wlCtKoy5n3mkFDongfuaobpDK1 X-Received: by 2002:a50:9505:0:b0:416:4496:5ec4 with SMTP id u5-20020a509505000000b0041644965ec4mr4323943eda.309.1646640575279; Mon, 07 Mar 2022 00:09:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2xIp5JRTTzEh0b9kN02MCecpWBHOKgNZ/2vrmHcEo1ZMQRcV8NeBt353n0K2lxOS7+4TSFw== X-Received: by 2002:a50:9505:0:b0:416:4496:5ec4 with SMTP id u5-20020a509505000000b0041644965ec4mr4323929eda.309.1646640575081; Mon, 07 Mar 2022 00:09:35 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:34 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/7] tty: serial: samsung: simplify getting OF match data Date: Mon, 7 Mar 2022 09:09:25 +0100 Message-Id: <20220307080925.54131-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_000937_932790_AE45D319 X-CRM114-Status: GOOD ( 14.08 ) 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 Simplify the code with of_device_get_match_data(). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 3ffae912217c..61c530bb377f 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2150,23 +2150,16 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, /* Device driver serial port probe */ -#ifdef CONFIG_OF -static const struct of_device_id s3c24xx_uart_dt_match[]; -#endif - static int probe_index; static inline const struct s3c24xx_serial_drv_data * s3c24xx_get_driver_data(struct platform_device *pdev) { #ifdef CONFIG_OF - if (pdev->dev.of_node) { - const struct of_device_id *match; - - match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node); - return (struct s3c24xx_serial_drv_data *)match->data; - } + if (pdev->dev.of_node) + return of_device_get_match_data(&pdev->dev); #endif + return (struct s3c24xx_serial_drv_data *) platform_get_device_id(pdev)->driver_data; }