<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/ethernet/micrel, branch linux-5.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-10-07T05:53:14Z</updated>
<entry>
<title>net: ks8851: fix link error</title>
<updated>2021-10-07T05:53:14Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2021-09-27T14:13:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=477e7f62b35825bd4b085136ba91f4a0e519a22c'/>
<id>urn:sha1:477e7f62b35825bd4b085136ba91f4a0e519a22c</id>
<content type='text'>
[ Upstream commit 51bb08dd04a05035a64504faa47651d36b0f3125 ]

An object file cannot be built for both loadable module and built-in
use at the same time:

arm-linux-gnueabi-ld: drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common':
ks8851_common.c:(.text+0xf80): undefined reference to `__this_module'

Change the ks8851_common code to be a standalone module instead,
and use Makefile logic to ensure this is built-in if at least one
of its two users is.

Fixes: 797047f875b5 ("net: ks8851: Implement Parallel bus operations")
Link: https://lore.kernel.org/netdev/20210125121937.3900988-1-arnd@kernel.org/
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: micrel: move phy reg offsets to common header</title>
<updated>2021-06-14T19:54:43Z</updated>
<author>
<name>Michael Grzeschik</name>
</author>
<published>2021-06-14T04:31:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec4b94f9b37bf028cb9b9c39cd1c1cb5dd1ab40c'/>
<id>urn:sha1:ec4b94f9b37bf028cb9b9c39cd1c1cb5dd1ab40c</id>
<content type='text'>
Some micrel devices share the same PHY register defines. This patch
moves them to one common header so other drivers can reuse them.
And reuse generic MII_* defines where possible.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Reviewed-by: Vladimir Oltean &lt;olteanv@gmail.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: micrel: check return value after calling platform_get_resource()</title>
<updated>2021-06-07T21:07:22Z</updated>
<author>
<name>Yang Yingliang</name>
</author>
<published>2021-06-07T14:55:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20f1932e2282c58cb5ac59517585206cf5b385ae'/>
<id>urn:sha1:20f1932e2282c58cb5ac59517585206cf5b385ae</id>
<content type='text'>
It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.

Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ks8851: Make ks8851_read_selftest() return void</title>
<updated>2021-06-03T22:27:37Z</updated>
<author>
<name>Nathan Chancellor</name>
</author>
<published>2021-06-03T16:56:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=819fb78f695527fc015e0c93b23c6492f7257015'/>
<id>urn:sha1:819fb78f695527fc015e0c93b23c6492f7257015</id>
<content type='text'>
clang points out that ret in ks8851_read_selftest() is set but unused:

drivers/net/ethernet/micrel/ks8851_common.c:1028:6: warning: variable
'ret' set but not used [-Wunused-but-set-variable]
        int ret = 0;
            ^
1 warning generated.

The return code of this function has never been checked so just remove
ret and make the function return void.

Fixes: 3ba81f3ece3c ("net: Micrel KS8851 SPI network driver")
Suggested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: micrel: Fix wrong function name in comments</title>
<updated>2021-05-17T21:12:38Z</updated>
<author>
<name>Yang Shen</name>
</author>
<published>2021-05-17T04:45:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=229fd41f64474e3ca739f4128983f989f928bb42'/>
<id>urn:sha1:229fd41f64474e3ca739f4128983f989f928bb42</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/net/ethernet/micrel/ksz884x.c:2163: warning: expecting prototype for sw_get_board_storm(). Prototype was for sw_get_broad_storm() instead
 drivers/net/ethernet/micrel/ksz884x.c:2985: warning: expecting prototype for port_w_phy(). Prototype was for hw_w_phy() instead
 drivers/net/ethernet/micrel/ksz884x.c:4792: warning: expecting prototype for transmit_done(). Prototype was for tx_done() instead

Cc: Tristram Ha &lt;Tristram.Ha@micrel.com&gt;
Signed-off-by: Yang Shen &lt;shenyang39@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>of: net: pass the dst buffer to of_get_mac_address()</title>
<updated>2021-04-13T21:35:02Z</updated>
<author>
<name>Michael Walle</name>
</author>
<published>2021-04-12T17:47:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83216e3988cd196183542937c9bd58b279f946af'/>
<id>urn:sha1:83216e3988cd196183542937c9bd58b279f946af</id>
<content type='text'>
of_get_mac_address() returns a "const void*" pointer to a MAC address.
Lately, support to fetch the MAC address by an NVMEM provider was added.
But this will only work with platform devices. It will not work with
PCI devices (e.g. of an integrated root complex) and esp. not with DSA
ports.

There is an of_* variant of the nvmem binding which works without
devices. The returned data of a nvmem_cell_read() has to be freed after
use. On the other hand the return of_get_mac_address() points to some
static data without a lifetime. The trick for now, was to allocate a
device resource managed buffer which is then returned. This will only
work if we have an actual device.

Change it, so that the caller of of_get_mac_address() has to supply a
buffer where the MAC address is written to. Unfortunately, this will
touch all drivers which use the of_get_mac_address().

Usually the code looks like:

  const char *addr;
  addr = of_get_mac_address(np);
  if (!IS_ERR(addr))
    ether_addr_copy(ndev-&gt;dev_addr, addr);

This can then be simply rewritten as:

  of_get_mac_address(np, ndev-&gt;dev_addr);

Sometimes is_valid_ether_addr() is used to test the MAC address.
of_get_mac_address() already makes sure, it just returns a valid MAC
address. Thus we can just test its return code. But we have to be
careful if there are still other sources for the MAC address before the
of_get_mac_address(). In this case we have to keep the
is_valid_ether_addr() call.

The following coccinelle patch was used to convert common cases to the
new style. Afterwards, I've manually gone over the drivers and fixed the
return code variable: either used a new one or if one was already
available use that. Mansour Moufid, thanks for that coccinelle patch!

&lt;spml&gt;
@a@
identifier x;
expression y, z;
@@
- x = of_get_mac_address(y);
+ x = of_get_mac_address(y, z);
  &lt;...
- ether_addr_copy(z, x);
  ...&gt;

@@
identifier a.x;
@@
- if (&lt;+... x ...+&gt;) {}

@@
identifier a.x;
@@
  if (&lt;+... x ...+&gt;) {
      ...
  }
- else {}

@@
identifier a.x;
expression e;
@@
- if (&lt;+... x ...+&gt;@e)
-     {}
- else
+ if (!(e))
      {...}

@@
expression x, y, z;
@@
- x = of_get_mac_address(y, z);
+ of_get_mac_address(y, z);
  ... when != x
&lt;/spml&gt;

All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
compile-time tested.

Suggested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ks8851: remove definition of DEBUG</title>
<updated>2021-01-16T01:53:29Z</updated>
<author>
<name>Tom Rix</name>
</author>
<published>2021-01-15T15:31:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ada665b8fab46bc126b9f0660a86503781ab67c'/>
<id>urn:sha1:3ada665b8fab46bc126b9f0660a86503781ab67c</id>
<content type='text'>
Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
Link: https://lore.kernel.org/r/20210115153128.131026-1-trix@redhat.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: ks8851: Select PHYLIB and MICREL_PHY in Kconfig</title>
<updated>2021-01-13T02:42:36Z</updated>
<author>
<name>Marek Vasut</name>
</author>
<published>2021-01-11T12:50:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0791b92d2b6e1bf36aed0eae93a0ef85eaa3a62'/>
<id>urn:sha1:f0791b92d2b6e1bf36aed0eae93a0ef85eaa3a62</id>
<content type='text'>
The PHYLIB must be selected to provide mdiobus_*() functions, and the
MICREL_PHY is necessary too, as that is the only possible PHY attached
to the KS8851 (it is the internal PHY).

Fixes: ef3631220d2b ("net: ks8851: Register MDIO bus and the internal PHY")
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Cc: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Cc: Lukas Wunner &lt;lukas@wunner.de&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Link: https://lore.kernel.org/r/20210111125046.36326-1-marex@denx.de
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: ks8851: Register MDIO bus and the internal PHY</title>
<updated>2021-01-06T01:05:11Z</updated>
<author>
<name>Marek Vasut</name>
</author>
<published>2021-01-05T14:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef3631220d2b3d8d14cf64464760505baa60d6ac'/>
<id>urn:sha1:ef3631220d2b3d8d14cf64464760505baa60d6ac</id>
<content type='text'>
The KS8851 has a reduced internal PHY, which is accessible through its
registers at offset 0xe4. The PHY is compatible with KS886x PHY present
in Micrel switches, except the PHY ID Low/High registers are swapped.
Register MDIO bus so this PHY can be detected and probed by phylib.

Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Cc: Andrew Lunn &lt;andrew@lunn.ch&gt;
Cc: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Cc: Lukas Wunner &lt;lukas@wunner.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: micrel: convert comma to semicolon</title>
<updated>2020-12-10T00:23:08Z</updated>
<author>
<name>Zheng Yongjun</name>
</author>
<published>2020-12-09T13:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eba251f2e6bc068133b5a1d5c57b552c4aeec534'/>
<id>urn:sha1:eba251f2e6bc068133b5a1d5c57b552c4aeec534</id>
<content type='text'>
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
