mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
video: rockchip: mpp: fix get drv data type err
Fix issue that he drvdata obtained through dev_get_drvdata does not match the converted type. Change-Id: I4f5835c2fed609714ac6cb94197ca84a489a3d23 Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
This commit is contained in:
@@ -994,7 +994,7 @@ static int av1dec_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
mpp = &dec->mpp;
|
||||
platform_set_drvdata(pdev, dec);
|
||||
platform_set_drvdata(pdev, mpp);
|
||||
|
||||
if (pdev->dev.of_node) {
|
||||
match = of_match_node(mpp_av1dec_dt_match, pdev->dev.of_node);
|
||||
@@ -1042,39 +1042,19 @@ failed_get_irq:
|
||||
static int av1dec_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct av1dec_dev *dec = platform_get_drvdata(pdev);
|
||||
struct mpp_dev *mpp = platform_get_drvdata(pdev);
|
||||
|
||||
dev_info(dev, "remove device\n");
|
||||
mpp_dev_remove(&dec->mpp);
|
||||
av1dec_procfs_remove(&dec->mpp);
|
||||
mpp_dev_remove(mpp);
|
||||
av1dec_procfs_remove(mpp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void av1dec_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
int val;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct av1dec_dev *dec = platform_get_drvdata(pdev);
|
||||
struct mpp_dev *mpp = &dec->mpp;
|
||||
|
||||
dev_info(dev, "shutdown device\n");
|
||||
|
||||
atomic_inc(&mpp->srv->shutdown_request);
|
||||
ret = readx_poll_timeout(atomic_read,
|
||||
&mpp->task_count,
|
||||
val, val == 0, 1000, 200000);
|
||||
if (ret == -ETIMEDOUT)
|
||||
dev_err(dev, "wait total running time out\n");
|
||||
|
||||
dev_info(dev, "shutdown success\n");
|
||||
}
|
||||
|
||||
struct platform_driver rockchip_av1dec_driver = {
|
||||
.probe = av1dec_probe,
|
||||
.remove = av1dec_remove,
|
||||
.shutdown = av1dec_shutdown,
|
||||
.shutdown = mpp_dev_shutdown,
|
||||
.driver = {
|
||||
.name = AV1DEC_DRIVER_NAME,
|
||||
.of_match_table = of_match_ptr(mpp_av1dec_dt_match),
|
||||
|
||||
@@ -325,8 +325,8 @@ static int devfreq_target(struct device *dev,
|
||||
struct dev_pm_opp *opp;
|
||||
unsigned long target_volt, target_freq;
|
||||
unsigned long aclk_rate_hz, core_rate_hz, cabac_rate_hz;
|
||||
|
||||
struct rkvdec_dev *dec = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvdec_dev *dec = to_rkvdec_dev(mpp);
|
||||
struct devfreq *devfreq = dec->devfreq;
|
||||
struct devfreq_dev_status *stat = &devfreq->last_status;
|
||||
unsigned long old_clk_rate = stat->current_frequency;
|
||||
@@ -392,7 +392,8 @@ static int devfreq_target(struct device *dev,
|
||||
static int devfreq_get_cur_freq(struct device *dev,
|
||||
unsigned long *freq)
|
||||
{
|
||||
struct rkvdec_dev *dec = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvdec_dev *dec = to_rkvdec_dev(mpp);
|
||||
|
||||
*freq = clk_get_rate(dec->aclk_info.clk);
|
||||
|
||||
@@ -402,7 +403,8 @@ static int devfreq_get_cur_freq(struct device *dev,
|
||||
static int devfreq_get_dev_status(struct device *dev,
|
||||
struct devfreq_dev_status *stat)
|
||||
{
|
||||
struct rkvdec_dev *dec = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvdec_dev *dec = to_rkvdec_dev(mpp);
|
||||
struct devfreq *devfreq = dec->devfreq;
|
||||
|
||||
memcpy(stat, &devfreq->last_status, sizeof(*stat));
|
||||
@@ -1904,11 +1906,11 @@ static int rkvdec_probe(struct platform_device *pdev)
|
||||
static int rkvdec_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct rkvdec_dev *dec = platform_get_drvdata(pdev);
|
||||
struct mpp_dev *mpp = platform_get_drvdata(pdev);
|
||||
|
||||
dev_info(dev, "remove device\n");
|
||||
mpp_dev_remove(&dec->mpp);
|
||||
rkvdec_procfs_remove(&dec->mpp);
|
||||
mpp_dev_remove(mpp);
|
||||
rkvdec_procfs_remove(mpp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -711,8 +711,8 @@ static int rkvdec2_devfreq_target(struct device *dev,
|
||||
struct dev_pm_opp *opp;
|
||||
unsigned long target_volt, target_freq;
|
||||
int ret = 0;
|
||||
|
||||
struct rkvdec2_dev *dec = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvdec2_dev *dec = to_rkvdec2_dev(mpp);
|
||||
struct devfreq *devfreq = dec->devfreq;
|
||||
struct devfreq_dev_status *stat = &devfreq->last_status;
|
||||
unsigned long old_clk_rate = stat->current_frequency;
|
||||
@@ -774,7 +774,8 @@ static int rkvdec2_devfreq_get_dev_status(struct device *dev,
|
||||
static int rkvdec2_devfreq_get_cur_freq(struct device *dev,
|
||||
unsigned long *freq)
|
||||
{
|
||||
struct rkvdec2_dev *dec = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvdec2_dev *dec = to_rkvdec2_dev(mpp);
|
||||
|
||||
*freq = dec->core_last_rate_hz;
|
||||
|
||||
|
||||
@@ -850,8 +850,8 @@ static int rkvenc_devfreq_target(struct device *dev,
|
||||
struct dev_pm_opp *opp;
|
||||
unsigned long target_volt, target_freq;
|
||||
int ret = 0;
|
||||
|
||||
struct rkvenc_dev *enc = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvenc_dev *enc = to_rkvenc_dev(mpp);
|
||||
struct devfreq *devfreq = enc->devfreq;
|
||||
struct devfreq_dev_status *stat = &devfreq->last_status;
|
||||
unsigned long old_clk_rate = stat->current_frequency;
|
||||
@@ -913,7 +913,8 @@ static int rkvenc_devfreq_get_dev_status(struct device *dev,
|
||||
static int rkvenc_devfreq_get_cur_freq(struct device *dev,
|
||||
unsigned long *freq)
|
||||
{
|
||||
struct rkvenc_dev *enc = dev_get_drvdata(dev);
|
||||
struct mpp_dev *mpp = dev_get_drvdata(dev);
|
||||
struct rkvenc_dev *enc = to_rkvenc_dev(mpp);
|
||||
|
||||
*freq = enc->core_last_rate_hz;
|
||||
|
||||
|
||||
@@ -696,9 +696,8 @@ static int vdpp_probe(struct platform_device *pdev)
|
||||
vdpp = devm_kzalloc(dev, sizeof(struct vdpp_dev), GFP_KERNEL);
|
||||
if (!vdpp)
|
||||
return -ENOMEM;
|
||||
platform_set_drvdata(pdev, vdpp);
|
||||
|
||||
mpp = &vdpp->mpp;
|
||||
platform_set_drvdata(pdev, mpp);
|
||||
if (pdev->dev.of_node) {
|
||||
match = of_match_node(mpp_vdpp_dt_match, pdev->dev.of_node);
|
||||
if (match)
|
||||
@@ -745,37 +744,19 @@ static int vdpp_probe(struct platform_device *pdev)
|
||||
static int vdpp_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct vdpp_dev *vdpp = platform_get_drvdata(pdev);
|
||||
struct mpp_dev *mpp = platform_get_drvdata(pdev);
|
||||
|
||||
dev_info(dev, "remove device\n");
|
||||
mpp_dev_remove(&vdpp->mpp);
|
||||
vdpp_procfs_remove(&vdpp->mpp);
|
||||
mpp_dev_remove(mpp);
|
||||
vdpp_procfs_remove(mpp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vdpp_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
int val;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct vdpp_dev *vdpp = platform_get_drvdata(pdev);
|
||||
struct mpp_dev *mpp = &vdpp->mpp;
|
||||
|
||||
dev_info(dev, "shutdown device\n");
|
||||
|
||||
atomic_inc(&mpp->srv->shutdown_request);
|
||||
ret = readx_poll_timeout(atomic_read,
|
||||
&mpp->task_count,
|
||||
val, val == 0, 20000, 200000);
|
||||
if (ret == -ETIMEDOUT)
|
||||
dev_err(dev, "wait total running time out\n");
|
||||
}
|
||||
|
||||
struct platform_driver rockchip_vdpp_driver = {
|
||||
.probe = vdpp_probe,
|
||||
.remove = vdpp_remove,
|
||||
.shutdown = vdpp_shutdown,
|
||||
.shutdown = mpp_dev_shutdown,
|
||||
.driver = {
|
||||
.name = VDPP_DRIVER_NAME,
|
||||
.of_match_table = of_match_ptr(mpp_vdpp_dt_match),
|
||||
|
||||
Reference in New Issue
Block a user