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: 548818 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 E7440C4332F for ; Fri, 4 Mar 2022 08:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231430AbiCDIEz (ORCPT ); Fri, 4 Mar 2022 03:04:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230454AbiCDIEt (ORCPT ); Fri, 4 Mar 2022 03:04:49 -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 1D126B12E7 for ; Fri, 4 Mar 2022 00:04:02 -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 E2B203F619 for ; Fri, 4 Mar 2022 08:04:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381040; bh=3e0OL943ULPBWugjeGMyVyjYUaBzZNOV2dU/v9+3BRM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fJH9/WuUX4r1klXkhloCZ6Hsl013ZRaDKY1zr0UZ6qyAkf5WOviHTolYz3+3TBzhA Jx57v1qPhI+vSqUFycqjZP+w5yJY/aKWmj65+/l2k4QkoLat90dhDxeYXyTxV/L3r1 W5fQDLvzXSDPhwigfibo+jpVDkPLg61KF3aH/0DkBhx/dFhgTnGsp5jBYZgjBfTDYL CClRUmkpZyMKH7CqmJGfpg4u3jrJKgajBb7gYhP53hyLlaI0bRFjojunsPBTchxXtg m/Dec0a6CISH7gZfDEF/mRpBV6rgCI0nBy2t19Put4B6hGdEdNoHwZZZ0VPXTQj8T9 s2eAfjVT+ibDQ== Received: by mail-ej1-f72.google.com with SMTP id h22-20020a1709060f5600b006b11a2d3dcfso4045268ejj.4 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=V16SWNvjEtEuqU4NYJZKpnmK5x5OBmXw65wp6V2+QGLXG/x2RdnY8BlX924F10udyo Pw/N0yEvKK8ZNpsL/B14Ddxl+/BBtn0zCzsBqdM444JaJKv/8YdSt60R3kn/9mVUAxDT 5fGdF9Pa8b6nd22r3OaN2AP700HTRr/9fwJRFiWFzwR6iZMgcGBUOCDtXNtLLKdMex0z hV4fTPURmnLrVSTvUEcN0Hflcv+Tr3v4v0IZSLraRIC+/ZLPoK1c2gUQeMF9ijAzUAA2 pT3eqY7IDgLheLML6RIfbB9iokTebo+hT4m3QMXvoWmMnawRGOs/EpvAroy0fP67lE+M 00dg== X-Gm-Message-State: AOAM533PEUxXH47/BTq2MV5hyQQulOH8Tx3TaGhiltTHgBBtT5VRkiu0 kN8ql+obKWruCvzCkCWlW3ZCYcqqlqgEzWYmMOUpxIqC0li8kfc6ExmRH1/undS9EiRTVcZvgIn j6M2i3QYbqM/DZ6kZZVtibmT8LYNz2ihaO6TXrwSvygy+HEkL X-Received: by 2002:a17:906:b893:b0:6da:ab5e:ea34 with SMTP id hb19-20020a170906b89300b006daab5eea34mr2775930ejb.657.1646381040495; 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 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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, },