clk-raspberrypi.c (35f73cca1cecda0c1f8bb7d8be4ce5cd2d46ae8c) | clk-raspberrypi.c (bc163555603e4ae9c817675ad80d618a4cdbfa2d) |
---|---|
1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * Raspberry Pi driver for firmware controlled clocks 4 * 5 * Even though clk-bcm2835 provides an interface to the hardware registers for 6 * the system clocks we've had to factor out 'pllb' as the firmware 'owns' it. 7 * We're not allowed to change it directly as we might race with the 8 * over-temperature and under-voltage protections provided by the firmware. --- 330 unchanged lines hidden (view full) --- 339}; 340 341static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, 342 struct clk_hw_onecell_data *data) 343{ 344 struct rpi_firmware_get_clocks_response *clks; 345 int ret; 346 | 1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * Raspberry Pi driver for firmware controlled clocks 4 * 5 * Even though clk-bcm2835 provides an interface to the hardware registers for 6 * the system clocks we've had to factor out 'pllb' as the firmware 'owns' it. 7 * We're not allowed to change it directly as we might race with the 8 * over-temperature and under-voltage protections provided by the firmware. --- 330 unchanged lines hidden (view full) --- 339}; 340 341static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, 342 struct clk_hw_onecell_data *data) 343{ 344 struct rpi_firmware_get_clocks_response *clks; 345 int ret; 346 |
347 /* 348 * The firmware doesn't guarantee that the last element of 349 * RPI_FIRMWARE_GET_CLOCKS is zeroed. So allocate an additional 350 * zero element as sentinel. 351 */ |
|
347 clks = devm_kcalloc(rpi->dev, | 352 clks = devm_kcalloc(rpi->dev, |
348 RPI_FIRMWARE_NUM_CLK_ID, sizeof(*clks), | 353 RPI_FIRMWARE_NUM_CLK_ID + 1, sizeof(*clks), |
349 GFP_KERNEL); 350 if (!clks) 351 return -ENOMEM; 352 353 ret = rpi_firmware_property(rpi->firmware, RPI_FIRMWARE_GET_CLOCKS, 354 clks, 355 sizeof(*clks) * RPI_FIRMWARE_NUM_CLK_ID); 356 if (ret) --- 116 unchanged lines hidden --- | 354 GFP_KERNEL); 355 if (!clks) 356 return -ENOMEM; 357 358 ret = rpi_firmware_property(rpi->firmware, RPI_FIRMWARE_GET_CLOCKS, 359 clks, 360 sizeof(*clks) * RPI_FIRMWARE_NUM_CLK_ID); 361 if (ret) --- 116 unchanged lines hidden --- |