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, },