From patchwork Fri Mar 4 08:03:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 548465 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA4B9C433EF for ; Fri, 4 Mar 2022 08:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbiCDIEs (ORCPT ); Fri, 4 Mar 2022 03:04:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbiCDIEr (ORCPT ); Fri, 4 Mar 2022 03:04:47 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F8B6AD101 for ; Fri, 4 Mar 2022 00:04:00 -0800 (PST) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.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-0.canonical.com (Postfix) with ESMTPS id C5F623F610 for ; Fri, 4 Mar 2022 08:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381038; bh=HoXAShC7EBsK4KdfVtpMogYLZUITR5x/YL0IUbkIHfM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=OeTL8Y0B7ayWAZU236HH7OgT+g8ytvyQXDvrQAJTtadvDTHpWqv7DT8xhUW83UZ7n mI9CLo3f8ZIFRgWCb3WqWDtBjmS7vipsqWgezJtZ2aCXyocLmokxTq1rsi4XXnv6Ax dM60H21FLdcc3R2OOmAdmPczdb+2VGOiDZ2Q57H0yqu+FKapRXGw/Ui4NhsrpQxStm QVgzPZJ8vTrGfnIVScfsoQYBVW82f0NwGnHQsEARA/fYfIrHQ31AFM09AhBKTfHtBB DgHTUdAOpt6PqiId9cej2zv8EyIHz1oUCdEHIsWFsFZkREb/CT67plcHMgaTCn/cE/ QNiull8Tf9FZg== Received: by mail-ed1-f70.google.com with SMTP id r9-20020a05640251c900b00412d54ea618so4190569edd.3 for ; Fri, 04 Mar 2022 00:03:58 -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:mime-version :content-transfer-encoding; bh=HoXAShC7EBsK4KdfVtpMogYLZUITR5x/YL0IUbkIHfM=; b=Ex/4AO7BySM0YUeOBnfxuzjcGqzgX9bbrQjixQsZM9+i30UfJ2dvWL/t9qlnW5ZnRz 6f70/6ryf6zTLWBjyz/07IPg6KLE2r7irSkM05J5VURb09kylFfX/Ake2FgqyBE3UgOB QEuYp0xWdJSFENv6y1oVy6CSUCs7IfF83t1257NO6cji4aLJhRRKhPQwc5B9qxwlzGIb UQRYoPhHGM9P0Pa7PSslHvTM+u2IPV7MBe1jOdYvfsklAt6Ddhjr3htoZT1hpFNUEVJb TD4uKDdUNBr6vAbqxE3eI1NkA5RULV08A8MVRWK+ccUs9QeDQ9NDUGulsthxhNlry8bF 41sg== X-Gm-Message-State: AOAM530iAN6Pkm8ZeyZlJcgTLukd8sx1Of0sPHbi9652uXg3MTv/yz6O p4jzaAk9gdO1RlhLUEocxkq8dZR8xtXUcY6etKtAX6jWIY1asAqJ/ggzKLsAwGLoK4nvHAbUDDf oMFpVfVCiMuyeRkUXw0pLhBruUXpCJMfOy4yz/VX5bQ== X-Received: by 2002:a17:906:5011:b0:6cf:82ff:f1bf with SMTP id s17-20020a170906501100b006cf82fff1bfmr30210292ejj.69.1646381037955; Fri, 04 Mar 2022 00:03:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJz43El0g6b5OISJGpRpQ/02j8Wy7rzIIgM4+un5VZ3Pj2PD9d8J1Duaat4JpHIv+dYxCDdCwA== X-Received: by 2002:a17:906:5011:b0:6cf:82ff:f1bf with SMTP id s17-20020a170906501100b006cf82fff1bfmr30210272ejj.69.1646381037705; Fri, 04 Mar 2022 00:03:57 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id rv11-20020a17090710cb00b006d5c0cd5e0dsm1481465ejb.82.2022.03.04.00.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 00:03:57 -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 1/7] tty: serial: samsung: embed s3c24xx_uart_info in parent structure Date: Fri, 4 Mar 2022 09:03:42 +0100 Message-Id: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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 --- 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 Fri Mar 4 08:03:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 548464 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF20DC43219 for ; Fri, 4 Mar 2022 08:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbiCDIE4 (ORCPT ); Fri, 4 Mar 2022 03:04:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbiCDIEy (ORCPT ); Fri, 4 Mar 2022 03:04:54 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E01C8D95EC for ; Fri, 4 Mar 2022 00:04:05 -0800 (PST) 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 448EC3F615 for ; Fri, 4 Mar 2022 08:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381044; bh=0kJxljmXqNGTN5eMb3x4xxptqrabkXZDbHX7wYX3Zgs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SIR33sfQOuew9IIWRZ8L9pIhMHNVvAOa+bjYV/mckGlYYeQzmbty8snoSbBX8vMDw 7MwxXV5pu573HLUd22XOeYIASwDQHkTdpolLDq9TPewgvuIPRl9NfUKp8oMpJqrOA4 f89TtsFEXfz8JnS387tdijCPgHVmaX+oqyhuAF7oKPFZt+NKqzaIK+7WKHbews7onT UcoiQy5pFJmP+TL158eatNTcOnf6TJUvG0Np2yVF2aah3U1psgSZB2ca1Sp0Yztfcc mVji85h828cE1bWWLF8ACFlz7rbhN0/z4WVyWgVDYpW/NJYChh2S9lEJb95dorV4kU Q+BP0GZYFRsWg== Received: by mail-ej1-f69.google.com with SMTP id i14-20020a17090639ce00b006dabe6a112fso320415eje.13 for ; Fri, 04 Mar 2022 00:04:04 -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=0kJxljmXqNGTN5eMb3x4xxptqrabkXZDbHX7wYX3Zgs=; b=4OjZh9PWpf6uzZnWkHCjaKvQLxxlqK3HcEJZTXrvBZztIUzaGPKOhY6bv8gSKqUgws ENSQJEVPDsoge9jouwHIOUvrgQP1FXJ3+aeV2a2rsY4+qZEDK+VJLkWChV5P62mcD31p VWz8hgILeUNcvFg0JFUeF09w9QN3fqpiRRmDJ/JWOgIEaJ2fLMNz0nPdqO/OC5Hu8Ykp KXN87LXFlLj2055BkBFHZdEOuRa2yy6qJbQ+elSqle9aS4wzZCRtdEKE7mBzOeiZvmcF GWuUjTc7cPEHA0iVn6iikKzaCWAT3DhSXkG27NlXWdJRzE4s8GsMoTkTFseNgu2a4KHa 6BZA== X-Gm-Message-State: AOAM530RMF47jATGTuTzqU1vaZyJROgyZALG891JjplJDEPLkBsHdd/o mRyM1apF3OHktB0bJSw48Gg+OfjDQhDpttLVUPEbR0IBNuIMy2it3y+Kfjwakq487Ia2Wu1NpHa OAInjhqX7Y+xWOTh191yQqIKYKJfUsCgrJIuowrpeAw== X-Received: by 2002:a05:6402:3486:b0:409:8ed0:9340 with SMTP id v6-20020a056402348600b004098ed09340mr38136582edc.255.1646381042926; Fri, 04 Mar 2022 00:04:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+80NQg1qjGxzXwSnkNAPo7pilmgr6uO9HNvq8gSWafsXxSwmS24hqLp+IqtbfmR78BXE2qw== X-Received: by 2002:a05:6402:3486:b0:409:8ed0:9340 with SMTP id v6-20020a056402348600b004098ed09340mr38136568edc.255.1646381042702; Fri, 04 Mar 2022 00:04:02 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id rv11-20020a17090710cb00b006d5c0cd5e0dsm1481465ejb.82.2022.03.04.00.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 00:04:02 -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 4/7] tty: serial: samsung: constify UART name Date: Fri, 4 Mar 2022 09:03:45 +0100 Message-Id: <20220304080348.218581-4-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> References: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The UART name from driver data holds only string literals. Signed-off-by: Krzysztof Kozlowski --- 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 0b4f40044e87..279c413f2300 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 Fri Mar 4 08:03: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: 548463 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C55CEC433FE for ; Fri, 4 Mar 2022 08:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232032AbiCDIFE (ORCPT ); Fri, 4 Mar 2022 03:05:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbiCDIE4 (ORCPT ); Fri, 4 Mar 2022 03:04:56 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086E5105AA8 for ; Fri, 4 Mar 2022 00:04:07 -0800 (PST) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.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-0.canonical.com (Postfix) with ESMTPS id 533D23F61F for ; Fri, 4 Mar 2022 08:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381046; bh=T44npRNeKYD0vpyzx7RQhW2Cib6n/i6fxec+7s1/j58=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pGAIqBHvBOdWcS7dIr8DY6pNM9wexYrKgz69XViHk/JPx+Ah5uLHuwwmWSBOjo3b1 Zt4Vt50wp6FlgNhrhYDozlK6E4MYi8DeqyRIlSugD2+D0YVIjm4aeio4dmGDnk5BzX uG1I9B5w3HjAVOVeOisJY3juHiMF3/QRgLoFjnZTHUr+82bF/KW4nHjvB2hOcj/xps +7TOMK09yR3rCuj286wWs8BOYmpcsKpaxWUXm1UmT0H132evmvx9gqBf1St/iPKFOl R89DNXDTpcUf4incQrRr4Dfmg7V2Nzqoui0MsqQLBl/eKFoXsUOh2V2szh3f4d3N6g MpQKL6w639C4A== Received: by mail-ed1-f70.google.com with SMTP id j10-20020a05640211ca00b004090fd8a936so4199951edw.23 for ; Fri, 04 Mar 2022 00:04:06 -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=T44npRNeKYD0vpyzx7RQhW2Cib6n/i6fxec+7s1/j58=; b=p7q5hFHNsFyhVnKyrbyrBUxQX1fxRjwbVH9OoBgWhrxKyKZrw8xWxWyCzhzlS3M5E/ e5bHmR9CdWx8VOOfgpEYQ0omb9EI3VI2NqwjjEe4qJ4ySrc/ODBIK61UmZ7dzdEVoUpS WzWCoUrdf9W/2mWY2jDgUeOzNWnPcyHW0MVrEgiA2LswyNAKPZjBWhpjkWUmIr0UKFKm 1CvSPmWb2T4SyPiZL008iUgt7txIsP3NbVkbgKrA6Bf7ZnVNkMxYHx/FbwnuYNAAZS9j S0wOBiFYguoWvfjauWB4UeQq5FryO/ge/NUbWDoGhifNOKrLCTnjSH4+6voQcGBUXCdN x6XQ== X-Gm-Message-State: AOAM531GqUZQJJ2rX0QTrbYgl44b6OGY//+GxJ0y63bYbYqAHtTa1vvd CVN5ybn+f1RQpgrUD1lgRbvVwf9ATbjcOEtpp9Vsxa6TAdPHWcxd7Ab7VD3PlGmUG22/sgEK8Gr lm8oBy2ajOburBpGwPCdz853rim+2QZR5u5WVUvzRaw== X-Received: by 2002:aa7:c1d7:0:b0:415:9906:8900 with SMTP id d23-20020aa7c1d7000000b0041599068900mr14995503edp.360.1646381045100; Fri, 04 Mar 2022 00:04:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQx+JALUcgr+aV10z5DLRK2lWPO6mxFP6+bRPUxVe5mDfuxGx3aQWGNaHOFHObaAzRiHXZiw== X-Received: by 2002:aa7:c1d7:0:b0:415:9906:8900 with SMTP id d23-20020aa7c1d7000000b0041599068900mr14995487edp.360.1646381044922; Fri, 04 Mar 2022 00:04:04 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id rv11-20020a17090710cb00b006d5c0cd5e0dsm1481465ejb.82.2022.03.04.00.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 00:04:03 -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 5/7] tty: serial: samsung: constify s3c24xx_serial_drv_data members Date: Fri, 4 Mar 2022 09:03:46 +0100 Message-Id: <20220304080348.218581-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> References: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The driver data (struct s3c24xx_serial_drv_data) is never modified, so also its members can be make const. Except code style this has no impact because the structure itself is always a const. Signed-off-by: Krzysztof Kozlowski --- 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 279c413f2300..eecefff5c4a4 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 Fri Mar 4 08:03:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 548462 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C6D7C433F5 for ; Fri, 4 Mar 2022 08:04:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233804AbiCDIF0 (ORCPT ); Fri, 4 Mar 2022 03:05:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233006AbiCDIFC (ORCPT ); Fri, 4 Mar 2022 03:05:02 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C26C6BD7D9 for ; Fri, 4 Mar 2022 00:04:09 -0800 (PST) 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 AD04A3F613 for ; Fri, 4 Mar 2022 08:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381047; bh=rlX9LT2Ku3zafWWNfSgPawKn9LilfNFaq1DtAqUhXpM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IM7SuxZipeNQoHHawU6CiA74eJTir1weyfXATGcjUgJLMrmM5iitcR2sIUVlpxwBW P7ZIEMzEdUhZuKHqHOevCOynGEAwAxmenDn4lpWGJZOitxp9XQE08LFlqtRRY+b5S9 v/iZkP9fSW4i3ORw5Q0CDLFMHLyX4lDWk40G1+Vu+O8EqIB0JMrTuF4nndEpw0tocb ZwJykDT8uiAC9v/J9VYI4JIkRrkKtXJN06kdzAC1ogf/iCHOSzJfDvs7MmpL8AsCFM keyiDoo11KcSPtGbblcmtQliYZYT71FVKtwa3Shq6XZ+itxti+qLFcmgJO/wGAAN3S ZHgtsqJL1a8cw== Received: by mail-ej1-f72.google.com with SMTP id k16-20020a17090632d000b006ae1cdb0f07so4038018ejk.16 for ; Fri, 04 Mar 2022 00:04:07 -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=rlX9LT2Ku3zafWWNfSgPawKn9LilfNFaq1DtAqUhXpM=; b=O67qsQx6RMIv05AkewXdB9BI8+1pImwiHIWnTyPUUhb6UMd4+kylDZ6WfL/SP01eq+ /L0mypzqmBe/zLtEoTVVHjYjm4A4m+CucI0/XhUIirKHA9D6Xzak8Yhb6UkSmteJGQZq YyJNPlgSF0Fx7VlzVQMIYIUnusbiBeAJUvC5Pp98SWhdyHkoP8JJjPBvVRB7jBHPjk7L WyVpB5qrQ5gnljj+wHZXtSmSnq3zE7he9gC5xKYsNtOHmzxH23+6U0uI5uM+GRwTfhgH bUyJeC9/doHCrYuhsWsyneZVJQmvnPpn56ti/sL428aPmknGvryXx3AI2XG92mC+KMUv bs4g== X-Gm-Message-State: AOAM532ShsKKVk80JQYQqAWGBoqF7KttEPkySUGPOmWejzTbnnB0QIMK aq7npKHPw2yM5uufZy3atEzFv4BLmFQMycLLzH4tv/0TOMtxkdKrxNSUXiSUBCSQMqwGGxIoYFl tlpc/r4NUrn7hZwb9n4Re4qTfB9f5lIMGVcxFP3bc4w== X-Received: by 2002:a17:906:434e:b0:6d0:ed9c:68bc with SMTP id z14-20020a170906434e00b006d0ed9c68bcmr29023912ejm.70.1646381047109; Fri, 04 Mar 2022 00:04:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9NTQ5aaCe/mw4aEV5jifd4tz1CDgIbNknK5DSvctYEEFyUW63B8TVoeIxQGRv9fsptQj8Sw== X-Received: by 2002:a17:906:434e:b0:6d0:ed9c:68bc with SMTP id z14-20020a170906434e00b006d0ed9c68bcmr29023896ejm.70.1646381046879; Fri, 04 Mar 2022 00:04:06 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id rv11-20020a17090710cb00b006d5c0cd5e0dsm1481465ejb.82.2022.03.04.00.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 00:04:06 -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 7/7] tty: serial: samsung: simplify getting OF match data Date: Fri, 4 Mar 2022 09:03:48 +0100 Message-Id: <20220304080348.218581-7-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> References: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Simplify the code with of_device_get_match_data(). Signed-off-by: Krzysztof Kozlowski --- 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 00e7c34fad46..76f7afd1b7f7 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; }