diff options
| author | Mark Charlebois <charlebm@gmail.com> | 2014-08-29 14:05:50 -0400 |
|---|---|---|
| committer | Rob Clark <robdclark@gmail.com> | 2014-09-11 06:49:20 -0400 |
| commit | fc886107c55634415d24584008ebac4edd074af1 (patch) | |
| tree | 19934eb8f37079018c5cb2048582eba861898c8c /drivers/gpu/drm/msm/hdmi | |
| parent | 3afdd8a0e26dfa8c4c67bef56d89fe53ed425f3d (diff) | |
drm/msm: Change nested function to static function
There is currently a nested function in Russel King's tree
for the msm HDMI driver.
The last nested function was removed from the Linux kernel
when the Thinkpad driver was fixed.
I believe nested functions are not desired upstream, and it
also breaks compilation with clang so here is a patch to
change the nested function into static function. The patch
works with both clang and gcc.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi')
| -rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index a125a7e32742..c6c9b02e0ada 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c | |||
| @@ -258,28 +258,30 @@ static void set_hdmi_pdev(struct drm_device *dev, | |||
| 258 | priv->hdmi_pdev = pdev; | 258 | priv->hdmi_pdev = pdev; |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | #ifdef CONFIG_OF | ||
| 262 | static int get_gpio(struct device *dev, struct device_node *of_node, const char *name) | ||
| 263 | { | ||
| 264 | int gpio = of_get_named_gpio(of_node, name, 0); | ||
| 265 | if (gpio < 0) { | ||
| 266 | char name2[32]; | ||
| 267 | snprintf(name2, sizeof(name2), "%s-gpio", name); | ||
| 268 | gpio = of_get_named_gpio(of_node, name2, 0); | ||
| 269 | if (gpio < 0) { | ||
| 270 | dev_err(dev, "failed to get gpio: %s (%d)\n", | ||
| 271 | name, gpio); | ||
| 272 | gpio = -1; | ||
| 273 | } | ||
| 274 | } | ||
| 275 | return gpio; | ||
| 276 | } | ||
| 277 | #endif | ||
| 278 | |||
| 261 | static int hdmi_bind(struct device *dev, struct device *master, void *data) | 279 | static int hdmi_bind(struct device *dev, struct device *master, void *data) |
| 262 | { | 280 | { |
| 263 | static struct hdmi_platform_config config = {}; | 281 | static struct hdmi_platform_config config = {}; |
| 264 | #ifdef CONFIG_OF | 282 | #ifdef CONFIG_OF |
| 265 | struct device_node *of_node = dev->of_node; | 283 | struct device_node *of_node = dev->of_node; |
| 266 | 284 | ||
| 267 | int get_gpio(const char *name) | ||
| 268 | { | ||
| 269 | int gpio = of_get_named_gpio(of_node, name, 0); | ||
| 270 | if (gpio < 0) { | ||
| 271 | char name2[32]; | ||
| 272 | snprintf(name2, sizeof(name2), "%s-gpio", name); | ||
| 273 | gpio = of_get_named_gpio(of_node, name2, 0); | ||
| 274 | if (gpio < 0) { | ||
| 275 | dev_err(dev, "failed to get gpio: %s (%d)\n", | ||
| 276 | name, gpio); | ||
| 277 | gpio = -1; | ||
| 278 | } | ||
| 279 | } | ||
| 280 | return gpio; | ||
| 281 | } | ||
| 282 | |||
| 283 | if (of_device_is_compatible(of_node, "qcom,hdmi-tx-8074")) { | 285 | if (of_device_is_compatible(of_node, "qcom,hdmi-tx-8074")) { |
| 284 | static const char *hpd_reg_names[] = {"hpd-gdsc", "hpd-5v"}; | 286 | static const char *hpd_reg_names[] = {"hpd-gdsc", "hpd-5v"}; |
| 285 | static const char *pwr_reg_names[] = {"core-vdda", "core-vcc"}; | 287 | static const char *pwr_reg_names[] = {"core-vdda", "core-vcc"}; |
| @@ -312,12 +314,12 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) | |||
| 312 | } | 314 | } |
| 313 | 315 | ||
| 314 | config.mmio_name = "core_physical"; | 316 | config.mmio_name = "core_physical"; |
| 315 | config.ddc_clk_gpio = get_gpio("qcom,hdmi-tx-ddc-clk"); | 317 | config.ddc_clk_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-clk"); |
| 316 | config.ddc_data_gpio = get_gpio("qcom,hdmi-tx-ddc-data"); | 318 | config.ddc_data_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-data"); |
| 317 | config.hpd_gpio = get_gpio("qcom,hdmi-tx-hpd"); | 319 | config.hpd_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-hpd"); |
| 318 | config.mux_en_gpio = get_gpio("qcom,hdmi-tx-mux-en"); | 320 | config.mux_en_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-en"); |
| 319 | config.mux_sel_gpio = get_gpio("qcom,hdmi-tx-mux-sel"); | 321 | config.mux_sel_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-sel"); |
| 320 | config.mux_lpm_gpio = get_gpio("qcom,hdmi-tx-mux-lpm"); | 322 | config.mux_lpm_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-lpm"); |
| 321 | 323 | ||
| 322 | #else | 324 | #else |
| 323 | static const char *hpd_clk_names[] = { | 325 | static const char *hpd_clk_names[] = { |
