Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'samsung-drivers-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers

Samsung SoC drivers for v7.1

Few cleanups in ACPM firmware drivers, used on Google GS101 and newer
Samsung Exynos SoCs. Notable change is removing 'const' in
'struct acpm_handle' pointers, because even though the code does not
modify pointed data, it immediately drops the const via cast. Also code
is not logically readable when a reference getters/putters (e.g.
acpm_handle_put()) take a pointer to const, because the meaning of "get"
and "put" implies changing the memory, even if that changeable field is
outside of pointed data.

* tag 'samsung-drivers-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
firmware: exynos-acpm: Drop fake 'const' on handle pointer
dt-bindings: firmware: google,gs101-acpm-ipc: add S2MPG11 secondary PMIC
firmware: exynos-acpm: Count acpm_xfer buffers with __counted_by_ptr
firmware: exynos-acpm: Count number of commands in acpm_xfer
firmware: exynos-acpm: Use unsigned int for acpm_pmic_linux_errmap index

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+120 -77
+48 -2
Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml
··· 37 37 maxItems: 1 38 38 39 39 pmic: 40 + deprecated: true 40 41 description: Child node describing the main PMIC. 41 42 type: object 42 43 additionalProperties: true ··· 45 44 properties: 46 45 compatible: 47 46 const: samsung,s2mpg10-pmic 47 + 48 + pmic-1: 49 + description: Child node describing the main PMIC. 50 + type: object 51 + additionalProperties: true 52 + 53 + properties: 54 + compatible: 55 + const: samsung,s2mpg10-pmic 56 + 57 + pmic-2: 58 + description: Child node describing the sub PMIC. 59 + type: object 60 + additionalProperties: true 61 + 62 + properties: 63 + compatible: 64 + const: samsung,s2mpg11-pmic 48 65 49 66 shmem: 50 67 description: ··· 81 62 82 63 examples: 83 64 - | 65 + #include <dt-bindings/gpio/gpio.h> 84 66 #include <dt-bindings/interrupt-controller/irq.h> 67 + #include <dt-bindings/regulator/samsung,s2mpg10-regulator.h> 85 68 86 69 power-management { 87 70 compatible = "google,gs101-acpm-ipc"; ··· 91 70 mboxes = <&ap2apm_mailbox>; 92 71 shmem = <&apm_sram>; 93 72 94 - pmic { 73 + pmic-1 { 95 74 compatible = "samsung,s2mpg10-pmic"; 96 75 interrupts-extended = <&gpa0 6 IRQ_TYPE_LEVEL_LOW>; 76 + 77 + vinl3m-supply = <&buck8m>; 97 78 98 79 regulators { 99 80 ldo1m { ··· 105 82 regulator-always-on; 106 83 }; 107 84 108 - // ... 85 + ldo20m { 86 + regulator-name = "vdd_dmics"; 87 + regulator-min-microvolt = <700000>; 88 + regulator-max-microvolt = <1300000>; 89 + regulator-always-on; 90 + samsung,ext-control = <S2MPG10_EXTCTRL_LDO20M_EN2>; 91 + }; 109 92 110 93 buck8m { 111 94 regulator-name = "vdd_mif"; ··· 119 90 regulator-max-microvolt = <1300000>; 120 91 regulator-always-on; 121 92 regulator-boot-on; 93 + }; 94 + }; 95 + }; 96 + 97 + pmic-2 { 98 + compatible = "samsung,s2mpg11-pmic"; 99 + interrupts-extended = <&gpa0 7 IRQ_TYPE_LEVEL_LOW>; 100 + 101 + vinl1s-supply = <&buck8m>; 102 + vinl2s-supply = <&buck6s>; 103 + 104 + regulators { 105 + buckd { 106 + regulator-name = "vcc_ufs"; 107 + regulator-ramp-delay = <6250>; 108 + enable-gpios = <&gpp0 1 GPIO_ACTIVE_HIGH>; 109 + samsung,ext-control = <S2MPG11_EXTCTRL_UFS_EN>; 122 110 }; 123 111 }; 124 112 };
+2 -2
drivers/clk/samsung/clk-acpm.c
··· 20 20 u32 id; 21 21 struct clk_hw hw; 22 22 unsigned int mbox_chan_id; 23 - const struct acpm_handle *handle; 23 + struct acpm_handle *handle; 24 24 }; 25 25 26 26 struct acpm_clk_variant { ··· 113 113 114 114 static int acpm_clk_probe(struct platform_device *pdev) 115 115 { 116 - const struct acpm_handle *acpm_handle; 116 + struct acpm_handle *acpm_handle; 117 117 struct clk_hw_onecell_data *clk_data; 118 118 struct clk_hw **hws; 119 119 struct device *dev = &pdev->dev;
+7 -6
drivers/firmware/samsung/exynos-acpm-dvfs.c
··· 5 5 * Copyright 2025 Linaro Ltd. 6 6 */ 7 7 8 + #include <linux/array_size.h> 8 9 #include <linux/bitfield.h> 9 10 #include <linux/firmware/samsung/exynos-acpm-protocol.h> 10 11 #include <linux/ktime.h> ··· 25 24 unsigned int acpm_chan_id, bool response) 26 25 { 27 26 xfer->acpm_chan_id = acpm_chan_id; 27 + xfer->txcnt = cmdlen; 28 28 xfer->txd = cmd; 29 - xfer->txlen = cmdlen; 30 29 31 30 if (response) { 31 + xfer->rxcnt = cmdlen; 32 32 xfer->rxd = cmd; 33 - xfer->rxlen = cmdlen; 34 33 } 35 34 } 36 35 ··· 43 42 cmd[3] = ktime_to_ms(ktime_get()); 44 43 } 45 44 46 - int acpm_dvfs_set_rate(const struct acpm_handle *handle, 45 + int acpm_dvfs_set_rate(struct acpm_handle *handle, 47 46 unsigned int acpm_chan_id, unsigned int clk_id, 48 47 unsigned long rate) 49 48 { ··· 51 50 u32 cmd[4]; 52 51 53 52 acpm_dvfs_init_set_rate_cmd(cmd, clk_id, rate); 54 - acpm_dvfs_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id, false); 53 + acpm_dvfs_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, false); 55 54 56 55 return acpm_do_xfer(handle, &xfer); 57 56 } ··· 63 62 cmd[3] = ktime_to_ms(ktime_get()); 64 63 } 65 64 66 - unsigned long acpm_dvfs_get_rate(const struct acpm_handle *handle, 65 + unsigned long acpm_dvfs_get_rate(struct acpm_handle *handle, 67 66 unsigned int acpm_chan_id, unsigned int clk_id) 68 67 { 69 68 struct acpm_xfer xfer; ··· 71 70 int ret; 72 71 73 72 acpm_dvfs_init_get_rate_cmd(cmd, clk_id); 74 - acpm_dvfs_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id, true); 73 + acpm_dvfs_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); 75 74 76 75 ret = acpm_do_xfer(handle, &xfer); 77 76 if (ret)
+2 -2
drivers/firmware/samsung/exynos-acpm-dvfs.h
··· 11 11 12 12 struct acpm_handle; 13 13 14 - int acpm_dvfs_set_rate(const struct acpm_handle *handle, 14 + int acpm_dvfs_set_rate(struct acpm_handle *handle, 15 15 unsigned int acpm_chan_id, unsigned int id, 16 16 unsigned long rate); 17 - unsigned long acpm_dvfs_get_rate(const struct acpm_handle *handle, 17 + unsigned long acpm_dvfs_get_rate(struct acpm_handle *handle, 18 18 unsigned int acpm_chan_id, 19 19 unsigned int clk_id); 20 20
+13 -13
drivers/firmware/samsung/exynos-acpm-pmic.c
··· 41 41 [2] = -EACCES, /* Write register can't be accessed or issues to access it. */ 42 42 }; 43 43 44 - static int acpm_pmic_to_linux_err(int err) 44 + static int acpm_pmic_to_linux_err(unsigned int err) 45 45 { 46 46 if (err >= 0 && err < ARRAY_SIZE(acpm_pmic_linux_errmap)) 47 47 return acpm_pmic_linux_errmap[err]; ··· 63 63 { 64 64 xfer->txd = cmd; 65 65 xfer->rxd = cmd; 66 - xfer->txlen = cmdlen; 67 - xfer->rxlen = cmdlen; 66 + xfer->txcnt = cmdlen; 67 + xfer->rxcnt = cmdlen; 68 68 xfer->acpm_chan_id = acpm_chan_id; 69 69 } 70 70 ··· 77 77 cmd[3] = ktime_to_ms(ktime_get()); 78 78 } 79 79 80 - int acpm_pmic_read_reg(const struct acpm_handle *handle, 80 + int acpm_pmic_read_reg(struct acpm_handle *handle, 81 81 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 82 82 u8 *buf) 83 83 { ··· 86 86 int ret; 87 87 88 88 acpm_pmic_init_read_cmd(cmd, type, reg, chan); 89 - acpm_pmic_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id); 89 + acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); 90 90 91 91 ret = acpm_do_xfer(handle, &xfer); 92 92 if (ret) ··· 107 107 FIELD_PREP(ACPM_PMIC_VALUE, count); 108 108 } 109 109 110 - int acpm_pmic_bulk_read(const struct acpm_handle *handle, 110 + int acpm_pmic_bulk_read(struct acpm_handle *handle, 111 111 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 112 112 u8 count, u8 *buf) 113 113 { ··· 119 119 return -EINVAL; 120 120 121 121 acpm_pmic_init_bulk_read_cmd(cmd, type, reg, chan, count); 122 - acpm_pmic_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id); 122 + acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); 123 123 124 124 ret = acpm_do_xfer(handle, &xfer); 125 125 if (ret) ··· 150 150 cmd[3] = ktime_to_ms(ktime_get()); 151 151 } 152 152 153 - int acpm_pmic_write_reg(const struct acpm_handle *handle, 153 + int acpm_pmic_write_reg(struct acpm_handle *handle, 154 154 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 155 155 u8 value) 156 156 { ··· 159 159 int ret; 160 160 161 161 acpm_pmic_init_write_cmd(cmd, type, reg, chan, value); 162 - acpm_pmic_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id); 162 + acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); 163 163 164 164 ret = acpm_do_xfer(handle, &xfer); 165 165 if (ret) ··· 187 187 } 188 188 } 189 189 190 - int acpm_pmic_bulk_write(const struct acpm_handle *handle, 190 + int acpm_pmic_bulk_write(struct acpm_handle *handle, 191 191 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 192 192 u8 count, const u8 *buf) 193 193 { ··· 199 199 return -EINVAL; 200 200 201 201 acpm_pmic_init_bulk_write_cmd(cmd, type, reg, chan, count, buf); 202 - acpm_pmic_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id); 202 + acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); 203 203 204 204 ret = acpm_do_xfer(handle, &xfer); 205 205 if (ret) ··· 220 220 cmd[3] = ktime_to_ms(ktime_get()); 221 221 } 222 222 223 - int acpm_pmic_update_reg(const struct acpm_handle *handle, 223 + int acpm_pmic_update_reg(struct acpm_handle *handle, 224 224 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 225 225 u8 value, u8 mask) 226 226 { ··· 229 229 int ret; 230 230 231 231 acpm_pmic_init_update_cmd(cmd, type, reg, chan, value, mask); 232 - acpm_pmic_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id); 232 + acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); 233 233 234 234 ret = acpm_do_xfer(handle, &xfer); 235 235 if (ret)
+5 -5
drivers/firmware/samsung/exynos-acpm-pmic.h
··· 11 11 12 12 struct acpm_handle; 13 13 14 - int acpm_pmic_read_reg(const struct acpm_handle *handle, 14 + int acpm_pmic_read_reg(struct acpm_handle *handle, 15 15 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 16 16 u8 *buf); 17 - int acpm_pmic_bulk_read(const struct acpm_handle *handle, 17 + int acpm_pmic_bulk_read(struct acpm_handle *handle, 18 18 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 19 19 u8 count, u8 *buf); 20 - int acpm_pmic_write_reg(const struct acpm_handle *handle, 20 + int acpm_pmic_write_reg(struct acpm_handle *handle, 21 21 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 22 22 u8 value); 23 - int acpm_pmic_bulk_write(const struct acpm_handle *handle, 23 + int acpm_pmic_bulk_write(struct acpm_handle *handle, 24 24 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 25 25 u8 count, const u8 *buf); 26 - int acpm_pmic_update_reg(const struct acpm_handle *handle, 26 + int acpm_pmic_update_reg(struct acpm_handle *handle, 27 27 unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 28 28 u8 value, u8 mask); 29 29 #endif /* __EXYNOS_ACPM_PMIC_H__ */
+16 -14
drivers/firmware/samsung/exynos-acpm.c
··· 205 205 rx_seqnum = FIELD_GET(ACPM_PROTOCOL_SEQNUM, rx_data->cmd[0]); 206 206 207 207 if (rx_seqnum == tx_seqnum) { 208 - memcpy(xfer->rxd, rx_data->cmd, xfer->rxlen); 208 + memcpy(xfer->rxd, rx_data->cmd, xfer->rxcnt * sizeof(*xfer->rxd)); 209 209 clear_bit(rx_seqnum - 1, achan->bitmap_seqnum); 210 210 } 211 211 } ··· 258 258 259 259 if (rx_data->response) { 260 260 if (rx_seqnum == tx_seqnum) { 261 - __ioread32_copy(xfer->rxd, addr, 262 - xfer->rxlen / 4); 261 + __ioread32_copy(xfer->rxd, addr, xfer->rxcnt); 263 262 rx_set = true; 264 263 clear_bit(seqnum, achan->bitmap_seqnum); 265 264 } else { ··· 268 269 * clear yet the bitmap. It will be cleared 269 270 * after the response is copied to the request. 270 271 */ 271 - __ioread32_copy(rx_data->cmd, addr, 272 - xfer->rxlen / 4); 272 + __ioread32_copy(rx_data->cmd, addr, xfer->rxcnt); 273 273 } 274 274 } else { 275 275 clear_bit(seqnum, achan->bitmap_seqnum); ··· 410 412 * 411 413 * Return: 0 on success, -errno otherwise. 412 414 */ 413 - int acpm_do_xfer(const struct acpm_handle *handle, const struct acpm_xfer *xfer) 415 + int acpm_do_xfer(struct acpm_handle *handle, const struct acpm_xfer *xfer) 414 416 { 415 417 struct acpm_info *acpm = handle_to_acpm_info(handle); 416 418 struct exynos_mbox_msg msg; ··· 423 425 424 426 achan = &acpm->chans[xfer->acpm_chan_id]; 425 427 426 - if (!xfer->txd || xfer->txlen > achan->mlen || xfer->rxlen > achan->mlen) 428 + if (!xfer->txd || 429 + (xfer->txcnt * sizeof(*xfer->txd) > achan->mlen) || 430 + (xfer->rxcnt * sizeof(*xfer->rxd) > achan->mlen)) 427 431 return -EINVAL; 428 432 429 433 if (!achan->poll_completion) { ··· 448 448 449 449 /* Write TX command. */ 450 450 __iowrite32_copy(achan->tx.base + achan->mlen * tx_front, 451 - xfer->txd, xfer->txlen / 4); 451 + xfer->txd, xfer->txcnt); 452 452 453 453 /* Advance TX front. */ 454 454 writel(idx, achan->tx.front); ··· 674 674 * acpm_handle_put() - release the handle acquired by acpm_get_by_phandle. 675 675 * @handle: Handle acquired by acpm_get_by_phandle. 676 676 */ 677 - static void acpm_handle_put(const struct acpm_handle *handle) 677 + static void acpm_handle_put(struct acpm_handle *handle) 678 678 { 679 679 struct acpm_info *acpm = handle_to_acpm_info(handle); 680 680 struct device *dev = acpm->dev; ··· 700 700 * @np: ACPM device tree node. 701 701 * 702 702 * Return: pointer to handle on success, ERR_PTR(-errno) otherwise. 703 + * 704 + * Note: handle CANNOT be pointer to const 703 705 */ 704 - static const struct acpm_handle *acpm_get_by_node(struct device *dev, 705 - struct device_node *np) 706 + static struct acpm_handle *acpm_get_by_node(struct device *dev, 707 + struct device_node *np) 706 708 { 707 709 struct platform_device *pdev; 708 710 struct device_link *link; ··· 745 743 * 746 744 * Return: pointer to handle on success, ERR_PTR(-errno) otherwise. 747 745 */ 748 - const struct acpm_handle *devm_acpm_get_by_node(struct device *dev, 749 - struct device_node *np) 746 + struct acpm_handle *devm_acpm_get_by_node(struct device *dev, 747 + struct device_node *np) 750 748 { 751 - const struct acpm_handle **ptr, *handle; 749 + struct acpm_handle **ptr, *handle; 752 750 753 751 ptr = devres_alloc(devm_acpm_release, sizeof(*ptr), GFP_KERNEL); 754 752 if (!ptr)
+5 -5
drivers/firmware/samsung/exynos-acpm.h
··· 8 8 #define __EXYNOS_ACPM_H__ 9 9 10 10 struct acpm_xfer { 11 - const u32 *txd; 12 - u32 *rxd; 13 - size_t txlen; 14 - size_t rxlen; 11 + const u32 *txd __counted_by_ptr(txcnt); 12 + u32 *rxd __counted_by_ptr(rxcnt); 13 + size_t txcnt; 14 + size_t rxcnt; 15 15 unsigned int acpm_chan_id; 16 16 }; 17 17 18 18 struct acpm_handle; 19 19 20 - int acpm_do_xfer(const struct acpm_handle *handle, 20 + int acpm_do_xfer(struct acpm_handle *handle, 21 21 const struct acpm_xfer *xfer); 22 22 23 23 #endif /* __EXYNOS_ACPM_H__ */
+5 -5
drivers/mfd/sec-acpm.c
··· 367 367 }; 368 368 369 369 struct sec_pmic_acpm_shared_bus_context { 370 - const struct acpm_handle *acpm; 370 + struct acpm_handle *acpm; 371 371 unsigned int acpm_chan_id; 372 372 u8 speedy_channel; 373 373 }; ··· 390 390 size_t count) 391 391 { 392 392 struct sec_pmic_acpm_bus_context *ctx = context; 393 - const struct acpm_handle *acpm = ctx->shared->acpm; 393 + struct acpm_handle *acpm = ctx->shared->acpm; 394 394 const struct acpm_pmic_ops *pmic_ops = &acpm->ops.pmic_ops; 395 395 size_t val_count = count - BITS_TO_BYTES(ACPM_ADDR_BITS); 396 396 const u8 *d = data; ··· 410 410 void *val_buf, size_t val_size) 411 411 { 412 412 struct sec_pmic_acpm_bus_context *ctx = context; 413 - const struct acpm_handle *acpm = ctx->shared->acpm; 413 + struct acpm_handle *acpm = ctx->shared->acpm; 414 414 const struct acpm_pmic_ops *pmic_ops = &acpm->ops.pmic_ops; 415 415 const u8 *r = reg_buf; 416 416 u8 reg; ··· 429 429 unsigned int val) 430 430 { 431 431 struct sec_pmic_acpm_bus_context *ctx = context; 432 - const struct acpm_handle *acpm = ctx->shared->acpm; 432 + struct acpm_handle *acpm = ctx->shared->acpm; 433 433 const struct acpm_pmic_ops *pmic_ops = &acpm->ops.pmic_ops; 434 434 435 435 return pmic_ops->update_reg(acpm, ctx->shared->acpm_chan_id, ctx->type, reg & 0xff, ··· 480 480 struct regmap *regmap_common, *regmap_pmic, *regmap; 481 481 const struct sec_pmic_acpm_platform_data *pdata; 482 482 struct sec_pmic_acpm_shared_bus_context *shared_ctx; 483 - const struct acpm_handle *acpm; 483 + struct acpm_handle *acpm; 484 484 struct device *dev = &pdev->dev; 485 485 int ret, irq; 486 486
+17 -23
include/linux/firmware/samsung/exynos-acpm-protocol.h
··· 14 14 struct device_node; 15 15 16 16 struct acpm_dvfs_ops { 17 - int (*set_rate)(const struct acpm_handle *handle, 18 - unsigned int acpm_chan_id, unsigned int clk_id, 19 - unsigned long rate); 20 - unsigned long (*get_rate)(const struct acpm_handle *handle, 17 + int (*set_rate)(struct acpm_handle *handle, unsigned int acpm_chan_id, 18 + unsigned int clk_id, unsigned long rate); 19 + unsigned long (*get_rate)(struct acpm_handle *handle, 21 20 unsigned int acpm_chan_id, 22 21 unsigned int clk_id); 23 22 }; 24 23 25 24 struct acpm_pmic_ops { 26 - int (*read_reg)(const struct acpm_handle *handle, 27 - unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 28 - u8 *buf); 29 - int (*bulk_read)(const struct acpm_handle *handle, 30 - unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 31 - u8 count, u8 *buf); 32 - int (*write_reg)(const struct acpm_handle *handle, 33 - unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 34 - u8 value); 35 - int (*bulk_write)(const struct acpm_handle *handle, 36 - unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 37 - u8 count, const u8 *buf); 38 - int (*update_reg)(const struct acpm_handle *handle, 39 - unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan, 40 - u8 value, u8 mask); 25 + int (*read_reg)(struct acpm_handle *handle, unsigned int acpm_chan_id, 26 + u8 type, u8 reg, u8 chan, u8 *buf); 27 + int (*bulk_read)(struct acpm_handle *handle, unsigned int acpm_chan_id, 28 + u8 type, u8 reg, u8 chan, u8 count, u8 *buf); 29 + int (*write_reg)(struct acpm_handle *handle, unsigned int acpm_chan_id, 30 + u8 type, u8 reg, u8 chan, u8 value); 31 + int (*bulk_write)(struct acpm_handle *handle, unsigned int acpm_chan_id, 32 + u8 type, u8 reg, u8 chan, u8 count, const u8 *buf); 33 + int (*update_reg)(struct acpm_handle *handle, unsigned int acpm_chan_id, 34 + u8 type, u8 reg, u8 chan, u8 value, u8 mask); 41 35 }; 42 36 43 37 struct acpm_ops { ··· 50 56 struct device; 51 57 52 58 #if IS_ENABLED(CONFIG_EXYNOS_ACPM_PROTOCOL) 53 - const struct acpm_handle *devm_acpm_get_by_node(struct device *dev, 54 - struct device_node *np); 59 + struct acpm_handle *devm_acpm_get_by_node(struct device *dev, 60 + struct device_node *np); 55 61 #else 56 62 57 - static inline const struct acpm_handle *devm_acpm_get_by_node(struct device *dev, 58 - struct device_node *np) 63 + static inline struct acpm_handle *devm_acpm_get_by_node(struct device *dev, 64 + struct device_node *np) 59 65 { 60 66 return NULL; 61 67 }