[PATCH 11/16] net: dm9000: Drop dm9000.h and staticize SROM access

Ramon Fried rfried.dev at gmail.com
Tue Apr 12 21:49:40 CEST 2022


On Mon, Apr 11, 2022 at 8:56 PM Marek Vasut <marex at denx.de> wrote:
>
> Dispose of dm9000.h because none of the function prototypes declared in
> it are called anywhere in the codebase. Staticize dm9000_read_srom_word()
> because it is now called only from within the dm9000 driver. Drop
> dm9000_write_srom_word() because it is no longer used.
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Ramon Fried <rfried.dev at gmail.com>
> ---
>  drivers/net/dm9000x.c | 13 +------------
>  include/dm9000.h      | 16 ----------------
>  2 files changed, 1 insertion(+), 28 deletions(-)
>  delete mode 100644 include/dm9000.h
>
> diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
> index 666883ee19e..3c0d848b10f 100644
> --- a/drivers/net/dm9000x.c
> +++ b/drivers/net/dm9000x.c
> @@ -53,7 +53,6 @@
>  #include <command.h>
>  #include <net.h>
>  #include <asm/io.h>
> -#include <dm9000.h>
>  #include <linux/delay.h>
>
>  #include "dm9000x.h"
> @@ -556,7 +555,7 @@ static int dm9000_rx(struct eth_device *dev)
>   * Read a word data from SROM
>   */
>  #if !defined(CONFIG_DM9000_NO_SROM)
> -void dm9000_read_srom_word(int offset, u8 *to)
> +static void dm9000_read_srom_word(int offset, u8 *to)
>  {
>         dm9000_iow(DM9000_EPAR, offset);
>         dm9000_iow(DM9000_EPCR, 0x4);
> @@ -566,16 +565,6 @@ void dm9000_read_srom_word(int offset, u8 *to)
>         to[1] = dm9000_ior(DM9000_EPDRH);
>  }
>
> -void dm9000_write_srom_word(int offset, u16 val)
> -{
> -       dm9000_iow(DM9000_EPAR, offset);
> -       dm9000_iow(DM9000_EPDRH, ((val >> 8) & 0xff));
> -       dm9000_iow(DM9000_EPDRL, (val & 0xff));
> -       dm9000_iow(DM9000_EPCR, 0x12);
> -       mdelay(8);
> -       dm9000_iow(DM9000_EPCR, 0);
> -}
> -
>  static void dm9000_get_enetaddr(struct eth_device *dev)
>  {
>         int i;
> diff --git a/include/dm9000.h b/include/dm9000.h
> deleted file mode 100644
> index f780e513f69..00000000000
> --- a/include/dm9000.h
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * NOTE:        DAVICOM DM9000 ethernet driver interface
> - *
> - * Authors:     Remy Bohmer <linux at bohmer.net>
> - */
> -#ifndef __DM9000_H__
> -#define __DM9000_H__
> -
> -/******************  function prototypes **********************/
> -#if !defined(CONFIG_DM9000_NO_SROM)
> -void dm9000_write_srom_word(int offset, u16 val);
> -void dm9000_read_srom_word(int offset, u8 *to);
> -#endif
> -
> -#endif /* __DM9000_H__ */
> --
> 2.35.1
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>


More information about the U-Boot mailing list