From patchwork Mon Feb 28 06:28:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12762398 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 802E2C433F5 for ; Mon, 28 Feb 2022 06:30:16 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ReQ8HnCQMtHmKFlhokWg5FNaG9eecs3I3pRSLIVHdXE=; b=Mr6klNTE7RhucP FGm6oe/1QPjAe8RAy5mtIMjS4ktUW9bd1d4vSgpbT59ihOfl/cnekNyV+MNz86IR5t6j/A0a6E+cw G1UcoK0OOVUFgo91EjHiCQwIJd7QUvQGzra0LADNHgIkpt9c09EIa4q8yPEH2ICaF+HnHjFadXBbv AxD0+1ysoLsrlWFJIJOQL5W0HJFNo9T0N8PzOl5nwUVXRbHkZzRzwsgUDVsM+Cj564Cdm857Xg7s7 /dbv/CSerpkgqtHmKIhqwwdMe49P/SKnIkpsbjL10BcvOkaNI5npFLu6JYgSpf9jN+WhR6WLo+Im6 hWfsICN6a9LDriQBbMBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOZWj-00AsvY-0r; Mon, 28 Feb 2022 06:28:57 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOZWf-00AsvB-E6 for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 06:28:55 +0000 Received: by mail-pj1-x102d.google.com with SMTP id d15so6901347pjg.1 for ; Sun, 27 Feb 2022 22:28:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kgkht8rO3+k+idfR5uRJ1HfsqsQMZyUwVEbEeZKhHjE=; b=kqM+hru6jSskCkg5PdmIDHNL7QpnS4FW4Nv3E1DGRt/E+U58Xi7K6hizyFaWCS3b2u tw16/3A7hqdcOfCtXaGPmN45ZyXeT8alr09PgE8W0EzWdcK2rU+q+nMTQSFWHngxi0cn vGuz7CR9RnMvxBdW6d6zERNdivLxnssk/m8xXs4YBhRLsTO3nxgIhvu1rTeFLlS42s0m l3fsryM3sssy/fjsTmtRSSWq0ItydwX2NuIqy6ILxAY4bWvicaY49GjwgJwO5VAbUVho Dx+Giy6D4MLhtazgXVlMT6ts8Pxq45yKBR6HBipdZ7eg6Xvd+HO9M2wPJ8TSfwHh+WDS pihA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=kgkht8rO3+k+idfR5uRJ1HfsqsQMZyUwVEbEeZKhHjE=; b=oUwa7ushPJzYlVhRXCHBLZbYVYxMUneU6OMAkeA4jenclxU6w+PIbDbuO/Vrk4zgZT YbAH9eihiiDI7TiHgTkqls300PYjp+Qgie+r2bfSZvLQ4DyBmyw0RbZU/knNssuzT8Fg vpO3fHpRiuqq48EG027U47umtZGco2jMNwYInZDhKsYh4FeYfKKeZOOsLbjy19++Ce1o 5W/A29KULXW8tBcoKyNmEPDZxP+gWlsl9doXr1XQHv6NHEqDibBTte2ASUfYhPW5z1y8 0HIW9an2D31YLciitEtwxagtx8nFegLf1FbjeVI1jMNely6iWAICeK1C4XhNam6BOTs9 ogTQ== X-Gm-Message-State: AOAM532rrmWK5y23u2zYNKNHNRxbbuhhxy35vyNto5++8lJTpgxRUpqe pR2yshG7QL6E0Jd6z2nnWZI= X-Google-Smtp-Source: ABdhPJyLO+XgLKspmv3xaH4VQ0Hs70/KY9rG8FX1VN1kW658ZWX2yIz1S/0nf6UGe1kKvH8LappEmQ== X-Received: by 2002:a17:90b:408b:b0:1bd:3839:1413 with SMTP id jb11-20020a17090b408b00b001bd38391413mr5874286pjb.138.1646029732542; Sun, 27 Feb 2022 22:28:52 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id 2-20020a631342000000b0037487b6b018sm9202701pgt.0.2022.02.27.22.28.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 22:28:51 -0800 (PST) From: Joel Stanley To: Corey Minyard , Andrew Jeffery Cc: openipmi-developer@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ipmi: kcs: aspeed: Remove old bindings support Date: Mon, 28 Feb 2022 16:58:40 +1030 Message-Id: <20220228062840.449215-1-joel@jms.id.au> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220227_222853_506157_C80D59EB X-CRM114-Status: GOOD ( 17.02 ) 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 It's been a few releases since we depreciated the "v1" bindings. Remove support from the driver as all known device trees have been updated to use the new bindings. Signed-off-by: Joel Stanley --- This applies on top of the patch to add ast2600 support. I kept them separate as the ast2600 change is suitable for backporting, but this one is not. drivers/char/ipmi/kcs_bmc_aspeed.c | 68 +++--------------------------- 1 file changed, 7 insertions(+), 61 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi/kcs_bmc_aspeed.c index b555286016b1..cdc88cde1e9a 100644 --- a/drivers/char/ipmi/kcs_bmc_aspeed.c +++ b/drivers/char/ipmi/kcs_bmc_aspeed.c @@ -128,11 +128,6 @@ struct aspeed_kcs_bmc { } obe; }; -struct aspeed_kcs_of_ops { - int (*get_channel)(struct platform_device *pdev); - int (*get_io_address)(struct platform_device *pdev, u32 addrs[2]); -}; - static inline struct aspeed_kcs_bmc *to_aspeed_kcs_bmc(struct kcs_bmc_device *kcs_bmc) { return container_of(kcs_bmc, struct aspeed_kcs_bmc, kcs_bmc); @@ -475,38 +470,7 @@ static const struct kcs_ioreg ast_kcs_bmc_ioregs[KCS_CHANNEL_MAX] = { { .idr = LPC_IDR4, .odr = LPC_ODR4, .str = LPC_STR4 }, }; -static int aspeed_kcs_of_v1_get_channel(struct platform_device *pdev) -{ - struct device_node *np; - u32 channel; - int rc; - - np = pdev->dev.of_node; - - rc = of_property_read_u32(np, "kcs_chan", &channel); - if ((rc != 0) || (channel == 0 || channel > KCS_CHANNEL_MAX)) { - dev_err(&pdev->dev, "no valid 'kcs_chan' configured\n"); - return -EINVAL; - } - - return channel; -} - -static int -aspeed_kcs_of_v1_get_io_address(struct platform_device *pdev, u32 addrs[2]) -{ - int rc; - - rc = of_property_read_u32(pdev->dev.of_node, "kcs_addr", addrs); - if (rc || addrs[0] > 0xffff) { - dev_err(&pdev->dev, "no valid 'kcs_addr' configured\n"); - return -EINVAL; - } - - return 1; -} - -static int aspeed_kcs_of_v2_get_channel(struct platform_device *pdev) +static int aspeed_kcs_of_get_channel(struct platform_device *pdev) { struct device_node *np; struct kcs_ioreg ioreg; @@ -535,12 +499,11 @@ static int aspeed_kcs_of_v2_get_channel(struct platform_device *pdev) if (!memcmp(&ast_kcs_bmc_ioregs[i], &ioreg, sizeof(ioreg))) return i + 1; } - return -EINVAL; } static int -aspeed_kcs_of_v2_get_io_address(struct platform_device *pdev, u32 addrs[2]) +aspeed_kcs_of_get_io_address(struct platform_device *pdev, u32 addrs[2]) { int rc; @@ -567,7 +530,6 @@ aspeed_kcs_of_v2_get_io_address(struct platform_device *pdev, u32 addrs[2]) static int aspeed_kcs_probe(struct platform_device *pdev) { - const struct aspeed_kcs_of_ops *ops; struct kcs_bmc_device *kcs_bmc; struct aspeed_kcs_bmc *priv; struct device_node *np; @@ -585,15 +547,11 @@ static int aspeed_kcs_probe(struct platform_device *pdev) return -ENODEV; } - ops = of_device_get_match_data(&pdev->dev); - if (!ops) - return -EINVAL; - - channel = ops->get_channel(pdev); + channel = aspeed_kcs_of_get_channel(pdev); if (channel < 0) return channel; - nr_addrs = ops->get_io_address(pdev, addrs); + nr_addrs = aspeed_kcs_of_get_io_address(pdev, addrs); if (nr_addrs < 0) return nr_addrs; @@ -678,22 +636,10 @@ static int aspeed_kcs_remove(struct platform_device *pdev) return 0; } -static const struct aspeed_kcs_of_ops of_v1_ops = { - .get_channel = aspeed_kcs_of_v1_get_channel, - .get_io_address = aspeed_kcs_of_v1_get_io_address, -}; - -static const struct aspeed_kcs_of_ops of_v2_ops = { - .get_channel = aspeed_kcs_of_v2_get_channel, - .get_io_address = aspeed_kcs_of_v2_get_io_address, -}; - static const struct of_device_id ast_kcs_bmc_match[] = { - { .compatible = "aspeed,ast2400-kcs-bmc", .data = &of_v1_ops }, - { .compatible = "aspeed,ast2500-kcs-bmc", .data = &of_v1_ops }, - { .compatible = "aspeed,ast2400-kcs-bmc-v2", .data = &of_v2_ops }, - { .compatible = "aspeed,ast2500-kcs-bmc-v2", .data = &of_v2_ops }, - { .compatible = "aspeed,ast2600-kcs-bmc", .data = &of_v2_ops }, + { .compatible = "aspeed,ast2400-kcs-bmc-v2" }, + { .compatible = "aspeed,ast2500-kcs-bmc-v2" }, + { .compatible = "aspeed,ast2600-kcs-bmc" }, { } }; MODULE_DEVICE_TABLE(of, ast_kcs_bmc_match);