From: Corey Minyard <minyard@acm.org>
To: Joel Stanley <joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>,
openipmi-developer@lists.sourceforge.net,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ipmi: kcs: aspeed: Remove old bindings support
Date: Mon, 28 Feb 2022 10:31:11 -0600 [thread overview]
Message-ID: <20220228163111.GD3457@minyard.net> (raw)
In-Reply-To: <20220228062840.449215-1-joel@jms.id.au>
On Mon, Feb 28, 2022 at 04:58:40PM +1030, Joel Stanley wrote:
> 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.
It always feels good to get rid of old stuff you don't need :-).
Applied for next release.
-corey
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> 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);
> --
> 2.34.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-02-28 16:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-28 6:28 [PATCH] ipmi: kcs: aspeed: Remove old bindings support Joel Stanley
2022-02-28 16:31 ` Corey Minyard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220228163111.GD3457@minyard.net \
--to=minyard@acm.org \
--cc=andrew@aj.id.au \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=openipmi-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.