From patchwork Mon Mar 7 08:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771338 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 3C22AC433F5 for ; Mon, 7 Mar 2022 08:10:39 +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=VFzwMY2lyKNbmZ XK/BCe8/RvhCmrs4Aajw4wOcezvkRXaYYlJijOgsc3Rqm9FT3h6iXHYPuKbOmmD1aVz7Zt67THO5l 3in/qhyJt13KQVbjw3julirzWEyYWxErzoBt1ptY7i4wNvU3CdEAdujROjKswl33HRsz76UN+dOPt xXessMo4XHeY2f5F0ojIPBrAmNX++rtmizZ1zK4ZYfEkMFB742AMvKCKVIS6jF5lvBOaQ5/DgWGu9 dSyNylYahDwtvhwOrRw1ZumyAzzj7N5rvcJVRoqIohwom6BppO0ppQ895WqXuvHp0ODJGQOUGIkiQ hQ5S+S9HeITqDRsbkypA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Pz-00GOGD-1t; Mon, 07 Mar 2022 08:08:35 +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 1nR8Pn-00GODH-Nk for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:08:25 +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-1.canonical.com (Postfix) with ESMTPS id 06C173F4C2 for ; Mon, 7 Mar 2022 08:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640502; bh=eR7Mc9vi/w7iGpwa309YiCzl9zkdxojESdgSBLZGEv4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sNowG0pJ2TSSnt9f6dK0Ww1LZSh1q8kAb99umQalH2q9mH0wEKBo9MenhslcAedR/ W3L2ZpGwQDu6+1eBObRj0iJdl+Dqt9B6wdQNg/PMy2MNB0p4NIKWnL8gJfvLe254HB zC1Tnfxe27a//jq4nRh6aLayAiIor4u368l1TY5h5ENmpdCPJvZ10L3lO3dHHnD6Fv weynCKoOaRknIL3VbnzeM6cTKRwzVlz1igzkBiyaeUOCQgilnve65sd7BzDB5Y4cgq EZD2q1y//mQzOiNTdcmZERyCd/vkrC1QkAhoIIiV4Oa8l+FxVOPfJnqVYskuwf2ok1 khaYAdL4m2sGw== Received: by mail-ej1-f69.google.com with SMTP id d7-20020a1709061f4700b006bbf73a7becso6597828ejk.17 for ; Mon, 07 Mar 2022 00:08:22 -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=JbPGGe83U0kOFO9k25r3cL3RyzbpG+570DGoH+cIpd5UldIi8cKIxoknuhdOyiq1Ls ne9qhJ018zSK2yPTMzSr7VwOGkCmBTynEBcs6jHw0b5rJMv6rT4JIFf1NmRiOkoffjCD 3Io35fhGLbpQXTzFu11AhpuiLJrHjzoUdD2fhbAHuFEogoANOHAdJJfDLrfGrzpWe36B xTby+6N4vRzswei6JBjlO+84Pfy4hXlM2vZjfZfXCNGimgf84VLGa2i9sIypt5ecmHZ9 4IfG/J5ysY4kSnEJ0mPOosGthZGFF2ceWoLY5xNPbzkewIJeTO4hv4RdW84nKtJRiwAb 3yTQ== X-Gm-Message-State: AOAM530bQxVo+/j1XJAozurJbRW2R+AkOHuuCZ61o27CzGPAlyh4adyi 6cA8CSCoRA8EMsZljRx08KS2EE96aTHX4+BFy1zod7MphVFmfPwyJYVMNURhyFiQE5e70Nx7nO5 yJwuq3VwvHG3NjLyOnIKhLPjLZsD51P5KQVjvCzZKbr1OhgHG5gGN X-Received: by 2002:a05:6402:239b:b0:415:a36e:99c0 with SMTP id j27-20020a056402239b00b00415a36e99c0mr9870069eda.283.1646640500563; Mon, 07 Mar 2022 00:08:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpUqnQcFhltzbiTgvk4iIo+PNlDFJdT98Fxk5y0pBKW8l18KW8SAiAS4UDqIaBE1SiIT6jnQ== X-Received: by 2002:a05:6402:239b:b0:415:a36e:99c0 with SMTP id j27-20020a056402239b00b00415a36e99c0mr9870056eda.283.1646640500396; Mon, 07 Mar 2022 00:08:20 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fs6-20020a170907600600b006da8ec6e4a6sm4444584ejc.26.2022.03.07.00.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:08:19 -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:04 +0100 Message-Id: <20220307080810.53847-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_000823_929997_20342ACA 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,