• Arnd Bergmann's avatar
    ethernet: cpts: fix function pointer cast warnings · 9b23fceb
    Arnd Bergmann authored
    clang-16 warns about the mismatched prototypes for the devm_* callbacks:
    
    drivers/net/ethernet/ti/cpts.c:691:12: error: cast from 'void (*)(struct clk_hw *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
      691 |                                        (void(*)(void *))clk_hw_unregister_mux,
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset'
      406 |         __devm_add_action_or_reset(dev, action, data, #action)
          |                                         ^~~~~~
    drivers/net/ethernet/ti/cpts.c:703:12: error: cast from 'void (*)(struct device_node *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
      703 |                                        (void(*)(void *))of_clk_del_provider,
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset'
      406 |         __devm_add_action_or_reset(dev, action, data, #action)
    
    Use separate helper functions for this instead, using the expected prototypes
    with a void* argument.
    
    Fixes: a3047a81 ("net: ethernet: ti: cpts: add support for ext rftclk selection")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9b23fceb
cpts.c 19.2 KB