mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3] usb: net: Add support for the Realtek RTL8152B/RTL8153
Date: Fri, 22 Oct 2021 13:31:59 +0200	[thread overview]
Message-ID: <20211022113159.GH25698@pengutronix.de> (raw)
In-Reply-To: <20211020104556.6829-1-o.rempel@pengutronix.de>

On Wed, Oct 20, 2021 at 12:45:56PM +0200, Oleksij Rempel wrote:
> +{
> +	u16 ocp_base, ocp_index;
> +
> +	ocp_base = addr & 0xf000;
> +	if (ocp_base != tp->ocp_base) {
> +		ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, ocp_base);
> +		tp->ocp_base = ocp_base;
> +	}
> +
> +	ocp_index = (addr & 0x0fff) | 0xb000;
> +	ocp_write_word(tp, MCU_TYPE_PLA, ocp_index, data);
> +}
> +
> +static void r8152_mdio_write(struct r8152 *tp, u32 reg_addr, u32 value)
> +{
> +	ocp_reg_write(tp, OCP_BASE_MII + reg_addr * 2, value);
> +}
> +
> +static int r8152_mdio_read(struct r8152 *tp, u32 reg_addr)
> +{
> +	return ocp_reg_read(tp, OCP_BASE_MII + reg_addr * 2);
> +}
> +
> +void sram_write(struct r8152 *tp, u16 addr, u16 data)
> +{
> +	ocp_reg_write(tp, OCP_SRAM_ADDR, addr);
> +	ocp_reg_write(tp, OCP_SRAM_DATA, data);
> +}

This function name is too generic for a global function. Please rename
to something with r8152 in it. Same for ocp_reg_write(),
generic_ocp_write() and others. Another way would be to put the firmware
into a header file and include that in the driver so that you do not
have to export any functions.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-10-22 11:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:45 Oleksij Rempel
2021-10-22 11:31 ` Sascha Hauer [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=20211022113159.GH25698@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox