Commit bbf47900 authored by Sascha Hauer's avatar Sascha Hauer Committed by Chanwoo Choi

PM / devfreq: rockchip-dfi: Embed desc into private data struct

No need for an extra allocation, just embed the struct
devfreq_event_desc into the private data struct.

Link: https://lore.kernel.org/lkml/20230704093242.583575-3-s.hauer@pengutronix.de/Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 1e0731c0
......@@ -49,7 +49,7 @@ struct dmc_usage {
*/
struct rockchip_dfi {
struct devfreq_event_dev *edev;
struct devfreq_event_desc *desc;
struct devfreq_event_desc desc;
struct dmc_usage ch_usage[RK3399_DMC_NUM_CH];
struct device *dev;
void __iomem *regs;
......@@ -204,14 +204,10 @@ static int rockchip_dfi_probe(struct platform_device *pdev)
data->dev = dev;
desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
if (!desc)
return -ENOMEM;
desc = &data->desc;
desc->ops = &rockchip_dfi_ops;
desc->driver_data = data;
desc->name = np->name;
data->desc = desc;
data->edev = devm_devfreq_event_add_edev(&pdev->dev, desc);
if (IS_ERR(data->edev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment