summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/hdmi/hdmi.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-11-18 16:40:44 +0300
committerRob Clark <robdclark@gmail.com>2014-11-21 16:56:19 +0300
commitd1a717bd2719d6416fdc5e9b65786f17c6c3facb (patch)
tree33ef2ed0b6794fad6ca384fee75202b796a88d81 /drivers/gpu/drm/msm/hdmi/hdmi.c
parent3f307963fc07953b56b51b18ed47416bf340320f (diff)
downloadlinux-d1a717bd2719d6416fdc5e9b65786f17c6c3facb.tar.xz
drm/msm/hdmi: remove useless kref
A left-over from prior to component framework. The original intent was to deal with hdmi getting unloaded before the master component, but that isn't really going to work anyways. These days with the component framework taking care to unload the master component first, we don't have to worry about this. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi/hdmi.c')
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index db8c3b45bc24..062c68725376 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -55,9 +55,8 @@ static irqreturn_t hdmi_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}
-void hdmi_destroy(struct kref *kref)
+static void hdmi_destroy(struct hdmi *hdmi)
{
- struct hdmi *hdmi = container_of(kref, struct hdmi, refcount);
struct hdmi_phy *phy = hdmi->phy;
if (phy)
@@ -85,8 +84,6 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
goto fail;
}
- kref_init(&hdmi->refcount);
-
hdmi->pdev = pdev;
hdmi->config = config;
@@ -183,7 +180,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
fail:
if (hdmi)
- hdmi_destroy(&hdmi->refcount);
+ hdmi_destroy(hdmi);
return ERR_PTR(ret);
}
@@ -269,12 +266,6 @@ fail:
#include <linux/of_gpio.h>
-static void set_hdmi(struct drm_device *dev, struct hdmi *hdmi)
-{
- struct msm_drm_private *priv = dev->dev_private;
- priv->hdmi = hdmi;
-}
-
#ifdef CONFIG_OF
static int get_gpio(struct device *dev, struct device_node *of_node, const char *name)
{
@@ -295,6 +286,8 @@ static int get_gpio(struct device *dev, struct device_node *of_node, const char
static int hdmi_bind(struct device *dev, struct device *master, void *data)
{
+ struct drm_device *drm = dev_get_drvdata(master);
+ struct msm_drm_private *priv = drm->dev_private;
static struct hdmi_platform_config config = {};
struct hdmi *hdmi;
#ifdef CONFIG_OF
@@ -389,14 +382,19 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
hdmi = hdmi_init(to_platform_device(dev));
if (IS_ERR(hdmi))
return PTR_ERR(hdmi);
- set_hdmi(dev_get_drvdata(master), hdmi);
+ priv->hdmi = hdmi;
return 0;
}
static void hdmi_unbind(struct device *dev, struct device *master,
void *data)
{
- set_hdmi(dev_get_drvdata(master), NULL);
+ struct drm_device *drm = dev_get_drvdata(master);
+ struct msm_drm_private *priv = drm->dev_private;
+ if (priv->hdmi) {
+ hdmi_destroy(priv->hdmi);
+ priv->hdmi = NULL;
+ }
}
static const struct component_ops hdmi_ops = {