# Re: \[net-next PATCH v9 1/6\] net: phy: pass PHY driver to .match\_phy\_device OP

- From: Andrew Lunn \<andrew@lunn.ch\>
- Date: 2025-05-13 12:08:15 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/05/3053036
- Thread: https://ratatoskr.run/linux-devicetree/2025/05/3050640/t.md

```text
On Tue, May 13, 2025 at 02:09:12PM +0800, kernel test robot wrote:
> Hi Christian,

Adding FUJITA Tomonori [ref].


> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on net-next/main]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/net-phy-pass-PHY-driver-to-match_phy_device-OP/20250512-024253
> base:   net-next/main
> patch link:    https://lore.kernel.org/r/20250511183933.3749017-2-ansuelsmth%40gmail.com
> patch subject: [net-next PATCH v9 1/6] net: phy: pass PHY driver to .match_phy_device OP
> config: x86_64-randconfig-r073-20250513 (https://download.01.org/0day-ci/archive/20250513/202505131337.ZjnU5fK1-lkp@intel.com/config)
> compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
> rustc: rustc 1.78.0 (9b00956e5 2024-04-29)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250513/202505131337.ZjnU5fK1-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot [ref]
> | Closes: https://lore.kernel.org/oe-kbuild-all/202505131337.ZjnU5fK1-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    ***
>    *** Rust bindings generator 'bindgen' < 0.69.5 together with libclang >= 19.1
>    *** may not work due to a bug (https://github.com/rust-lang/rust-bindgen/pull/2824),
>    *** unless patched (like Debian's).
>    ***   Your bindgen version:  0.65.1
>    ***   Your libclang version: 20.1.2
>    ***
>    ***
>    *** Please see Documentation/rust/quick-start.rst for details
>    *** on how to set up the Rust support.
>    ***
> >> error[E0308]: mismatched types
>    --> rust/kernel/net/phy.rs:527:18
>    |
>    527 |             Some(Adapter::<T>::match_phy_device_callback)
>    |             ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
>    |             |
>    |             arguments to this enum variant are incorrect
>    |
>    = note: expected fn pointer `unsafe extern "C" fn(*mut bindings::phy_device, *const phy_driver) -> _`
>    found fn item `unsafe extern "C" fn(*mut bindings::phy_device) -> _ {phy::Adapter::<T>::match_phy_device_callback}`
>    help: the type constructed contains `unsafe extern "C" fn(*mut bindings::phy_device) -> i32 {phy::Adapter::<T>::match_phy_device_callback}` due to the type of the argument passed
>    --> rust/kernel/net/phy.rs:527:13
>    |
>    527 |             Some(Adapter::<T>::match_phy_device_callback)
>    |             ^^^^^---------------------------------------^
>    |                  |
>    |                  this argument influences the type of `Some`
>    note: tuple variant defined here
>    --> /opt/cross/rustc-1.78.0-bindgen-0.65.1/rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:580:5
>    |
>    580 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
>    |     ^^^^
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
```
