Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1683549
| From | Sean Wang <sean.wang@mediatek.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: ethernet: mediatek: remove useless code in mtk_probe() |
| Date | 2017-07-08 09:00 +0200 |
| Message-ID | <u0RSF-7he-1@gated-at.bofh.it> (permalink) |
| References | <u0I2Z-DO-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi, Gustavo
It indeed is useless at the current time point.
but actually I will add new SoC support to the driver in the next week,
which requires the variable match :-(
Sean
On Fri, 2017-07-07 at 15:23 -0500, Gustavo A. R. Silva wrote:
> Remove useless local variables _match_, _soc_ and the code related.
>
> Notice that
>
> const struct of_device_id of_mtk_match[] = {
> { .compatible = "mediatek,mt2701-eth" },
> {},
> };
>
> So match->data is NULL.
>
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index adaaafc..b9a5a65 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -2401,15 +2401,10 @@ static int mtk_probe(struct platform_device *pdev)
> {
> struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> struct device_node *mac_np;
> - const struct of_device_id *match;
> - struct mtk_soc_data *soc;
> struct mtk_eth *eth;
> int err;
> int i;
>
> - match = of_match_device(of_mtk_match, &pdev->dev);
> - soc = (struct mtk_soc_data *)match->data;
> -
> eth = devm_kzalloc(&pdev->dev, sizeof(*eth), GFP_KERNEL);
> if (!eth)
> return -ENOMEM;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] net: ethernet: mediatek: add NULL check on of_match_device() return value "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-07-07 09:20 +0200
Re: [PATCH] net: ethernet: mediatek: add NULL check on of_match_device() return value Andrew Lunn <andrew@lunn.ch> - 2017-07-07 17:00 +0200
Re: [PATCH] net: ethernet: mediatek: add NULL check on of_match_device() return value "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-07-07 22:10 +0200
[PATCH] net: ethernet: mediatek: remove useless code in mtk_probe() "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-07-07 22:30 +0200
Re: [PATCH] net: ethernet: mediatek: remove useless code in mtk_probe() Sean Wang <sean.wang@mediatek.com> - 2017-07-08 09:00 +0200
Re: [PATCH] net: ethernet: mediatek: remove useless code in mtk_probe() David Miller <davem@davemloft.net> - 2017-07-08 12:30 +0200
Re: [PATCH] net: ethernet: mediatek: add NULL check on of_match_device() return value Matthias Brugger <matthias.bgg@gmail.com> - 2017-07-07 17:00 +0200
csiph-web