From patchwork Fri Mar 4 08:03:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12768688 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 B5EA4C433F5 for ; Fri, 4 Mar 2022 08:06:00 +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=a4mvJaAVDi/d9RMfMNbZyWskk2s5vqPgnhvVJZOmSyA=; b=BeRKmdJkQbrkk9 6OqbBtU0nZ/G9m5yL1vOY2piWJPEngMijX1iVQzt7ga1Z3AOiBy5Ov2a08H+CCPfso6qwQyIV8hTn 2qKeZUgqZAIlxwhOBNVudBsSSURlR7hoW0W4TubNkaVN9kEhxghftYXEUpQvBX2H8b8DZzH3IBM1J npBSPJ0Gz55axdNrUygqtLJ172h+Evemssl2TndKIQyuBm4NI1sc3eE0jSM3+j6+8iqk9KYDgWWZP diwydKUL4gjot18cFLUjURy4RhRyfw+x5KaBqaazELoclLQiKrmCbTLN7dcQBkl9glYQj2SBptKOb oxBDSY9cwsXdtsnCGQcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ2vP-008ucb-RU; Fri, 04 Mar 2022 08:04:32 +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 1nQ2uw-008uPb-7Q for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2022 08:04:04 +0000 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 01EEC3F61D for ; Fri, 4 Mar 2022 08:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381041; bh=3e0OL943ULPBWugjeGMyVyjYUaBzZNOV2dU/v9+3BRM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dk7cqAdRuoT7aNRaD957DDbCaKlmYhk2dYHTUAUMn+JITh/pYsX/FchtzHDwHXY2K RJ1MJWVB9eyK8JiOvMvM0Wp01WNHsehyvbEYZo50rxF+4AqmCc/jwi/JrzQ5MeqjPa QRULEDuGyyGdHjBkPmYrAsC24AH7u1SIOijM8L242SDr81a6PiOt/7dZurjYr16D/I 7UqBmpKxLbSFxerbOniqBEvchzs/7jEDv/AtyupLRX6YsAYgm2NUnNKNU1vAsbm/ja wamx9J8xz1OQ63XZl8qAp7VaQVSz+3rOefBRmUkGRtaN76rohSPWrzY42EhVy5OGwN I9kKdVQzx2xwg== Received: by mail-ed1-f70.google.com with SMTP id y26-20020a50ce1a000000b00415e9b35c81so1963080edi.9 for ; Fri, 04 Mar 2022 00:04:00 -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=3e0OL943ULPBWugjeGMyVyjYUaBzZNOV2dU/v9+3BRM=; b=AkUoQpmpsDjyNe7riXy2A/lSiH/OmLrMenNoF4awtVfJcKqKxdRxx2dw7jRnyFMuYb Ilf35YricEBnC+JoptcC7/fL4n4U21j1Y59GmI3jXeJMd0rucCvXv6/F4EfPp6wNgDun 8g1OK15a90B7ByOP2da2sXAy65lmJsYSpGprWnST6HaIwNKhNiJHxnaE5fMeEQMFh2/3 cHPmVeiQZPzqHSGsrYUNq2nW7r+HsfJKDI+iJs/yG9XkZ3Se4wU254Plfn31E2hVOEt7 gMnkXRQyi2cmHheKKQ7QyFoFxo98M1RqEpwyxWV33MTINHwUutby4p396uENoIu6Tq1R k/Fg== X-Gm-Message-State: AOAM533bNeY0XwF/weZqIDDRog4YAQdxCO/fIpwCrPoG3ONpm5Y3jLuG sjFHlVK4odpnN89wHGWF0dOOHzrsC9fTAoA9rjOdF1o1QIoifQILo3O4z9EyP63+UZTu2SrFWsz 9iRqwGYK6xyWLnMuN/3lY7sxXrsC+XR2Q6u0pHMAErcN/+Mi6nI1x X-Received: by 2002:a17:906:b893:b0:6da:ab5e:ea34 with SMTP id hb19-20020a170906b89300b006daab5eea34mr2775932ejb.657.1646381040496; Fri, 04 Mar 2022 00:04:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJztrEhqv7XA4mKAE9ME7ILqbE4bR93ikvOG8ZObHm+ovWA98IHNGgp6zN3rJmIjdWCuNjAqsw== X-Received: by 2002:a17:906:b893:b0:6da:ab5e:ea34 with SMTP id hb19-20020a170906b89300b006daab5eea34mr2775917ejb.657.1646381040298; Fri, 04 Mar 2022 00:04:00 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 00:03:59 -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 2/7] tty: serial: samsung: embed s3c2410_uartcfg in parent structure Date: Fri, 4 Mar 2022 09:03:43 +0100 Message-Id: <20220304080348.218581-2-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220304_000402_428226_948A3DCD X-CRM114-Status: GOOD ( 16.26 ) 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, },