On Thu, May 25, 2023 at 6:23 PM Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> wrote: > > Not tested on device tree but works nicely for ACPI :) Needs a better commit message obviously :-) ... > - ret = of_property_read_u32(pdev->dev.of_node, > + ret = device_property_read_u32(&pdev->dev, > "bus-frequency", &bus->bus_frequency); Oh, please avoid double effort, i.e. go further and use I²C core APIs for the timings. Oh, wait, do they use non-standard property?! ... > + bus->get_clk_reg_val = (u32 (*)(struct device *, u32)) > + device_get_match_data(&pdev->dev); Personally I prefer using pointers in driver_data so we can avoid ambiguity for the 0/NULL value returned by this call. But if 0 value is considered invalid here, it's probably fine. > + if (!bus->get_clk_reg_val) > bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val; > - else > - bus->get_clk_reg_val = (u32 (*)(struct device *, u32)) > - match->data; -- With Best Regards, Andy Shevchenko