Commit 40072ad6 authored by Brian Kim's avatar Brian Kim

ODROID-XU3/4: Clean up the compiler warning messages

This patch fix the routines caused to output the warning message in compile time as below:
- gcc version: gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)

drivers/cpufreq/cpufreq_interactive.c: In function ‘show_target_loads’:
drivers/cpufreq/cpufreq_interactive.c:805:6: warning: operation on ‘ret’ may be undefined [-Wsequence-point]
  ret += sprintf(buf + --ret, "\n");
      ^
drivers/cpufreq/cpufreq_interactive.c: In function ‘show_above_hispeed_delay’:
drivers/cpufreq/cpufreq_interactive.c:845:6: warning: operation on ‘ret’ may be undefined [-Wsequence-point]
  ret += sprintf(buf + --ret, "\n");
      ^
drivers/devfreq/exynos5422_bus_int.c: In function ‘exynos5_int_busfreq_target’:
drivers/devfreq/exynos5422_bus_int.c:945:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i, target_idx = LV_0;
      ^
drivers/devfreq/exynos5422_bus_int.c: In function ‘exynos5_devfreq_int_probe’:
drivers/devfreq/exynos5422_bus_int.c:1241:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i, index = -1;
      ^
drivers/devfreq/exynos5422_bus_int.c: In function ‘int_show_state’:
drivers/devfreq/exynos5422_bus_int.c:1121:10: warning: iteration 1u invokes undefined behavior [-Waggressive-loop-optimizations]
   len += snprintf(buf + len, write_cnt, "%ld %llu\n", int_bus_opp_list[i].freq,
          ^
drivers/devfreq/exynos5422_bus_int.c:1120:2: note: containing loop
  for (i = LV_0; i < LV_END; i++)
  ^
sound/soc/samsung/lpass.c: In function ‘lpass_proc_show’:
sound/soc/samsung/lpass.c:718:5: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void *’ [-Wformat=]
     ar->reg, ar->val);
     ^
In file included from backports/drivers/net/wireless/ath/ath10k/debug.c:19:0:
backports/backport-include/linux/debugfs.h:11:10: warning: ‘struct device’ declared inside parameter list
          void *data));
          ^
backports/backport-include/linux/debugfs.h:11:10: warning: its scope is only this definition or declaration, which is probably not what you want
In file included from backports/drivers/net/wireless/ath/wcn36xx/debug.c:19:0:
backports/backport-include/linux/debugfs.h:11:10: warning: ‘struct device’ declared inside parameter list
          void *data));
          ^
backports/backport-include/linux/debugfs.h:11:10: warning: its scope is only this definition or declaration, which is probably not what you want
backports/drivers/realtek/8192cu/hal/rtl8192c/rtl8192c_rf6052.c: In function ‘PHY_RFShadowRefresh’:
backports/drivers/realtek/8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1020:37: warning: iteration 63u invokes undefined behavior [-Waggressive-loop-optimizations]
    RF_Shadow[eRFPath][Offset].Value = 0;
                                     ^
backports/drivers/realtek/8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1018:3: note: containing loop
   for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
   ^
drivers/gpu/drm/exynos/exynos_drm_drv.c: In function ‘exynos_drm_init’:
drivers/gpu/drm/exynos/exynos_drm_drv.c:768:1: warning: label ‘err_unregister_pd’ defined but not used [-Wunused-label]
 err_unregister_pd:
 ^
net/core/sysctl_net_core.c:24:12: warning: ‘one’ defined but not used [-Wunused-variable]
 static int one = 1;
            ^
drivers/gpu/drm/exynos/exynos_hdmi.c: In function ‘hdmi_hpd_enable’:
drivers/gpu/drm/exynos/exynos_hdmi.c:233:27: warning: passing argument 3 of ‘kstrtoul’ from incompatible pointer type
     if(kstrtoul(line, 10, &gEnableHPD) != 0)    gEnableHPD = true;
                           ^
In file included from include/drm/drmP.h:45:0,
                 from drivers/gpu/drm/exynos/exynos_hdmi.c:17:
include/linux/kernel.h:255:32: note: expected ‘long unsigned int *’ but argument is of type ‘unsigned int *’
 static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
                                ^
drivers/gpu/drm/exynos/exynos_hdmi.c: At top level:
drivers/gpu/drm/exynos/exynos_hdmi.c:1985:13: warning: ‘hdmiphy_poweroff’ defined but not used [-Wunused-function]
 static void hdmiphy_poweroff(struct hdmi_context *hdata)
             ^
drivers/hardkernel/ioboard-spi.c:223:12: warning: ‘ioboard_spi_read_memory’ defined but not used [-Wunused-function]
 static int ioboard_spi_read_memory              (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
            ^
drivers/hardkernel/ioboard-spi.c:329:13: warning: ‘ioboard_spi_test’ defined but not used [-Wunused-function]
 static void ioboard_spi_test        (struct spi_device *spi)
             ^
drivers/hid/hid-appleir.c:347:22: warning: initialization from incompatible pointer type
  .input_configured = appleir_input_configured,
                      ^
drivers/hid/hid-appleir.c:347:22: warning: (near initialization for ‘appleir_driver.input_configured’)
In file included from backports/net/wireless/core.c:16:0:
backports/backport-include/linux/debugfs.h:11:10: warning: ‘struct device’ declared inside parameter list
          void *data));
          ^
backports/backport-include/linux/debugfs.h:11:10: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/hid/hid-magicmouse.c:590:22: warning: initialization from incompatible pointer type
  .input_configured = magicmouse_input_configured,
                      ^
drivers/hid/hid-magicmouse.c:590:22: warning: (near initialization for ‘magicmouse_driver.input_configured’)
drivers/hid/hid-ntrig.c:1026:22: warning: initialization from incompatible pointer type
  .input_configured = ntrig_input_configured,
                      ^
drivers/hid/hid-ntrig.c:1026:22: warning: (near initialization for ‘ntrig_driver.input_configured’)
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3580:17: warning: initialization from incompatible pointer type
  .get_station = cfg80211_rtw_get_station,
                 ^
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3580:17: warning: (near initialization for ‘rtw_cfg80211_ops.get_station’)
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3608:17: warning: initialization from incompatible pointer type
  .add_station = cfg80211_rtw_add_station,
                 ^
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3608:17: warning: (near initialization for ‘rtw_cfg80211_ops.add_station’)
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3609:17: warning: initialization from incompatible pointer type
  .del_station = cfg80211_rtw_del_station,
                 ^
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3609:17: warning: (near initialization for ‘rtw_cfg80211_ops.del_station’)
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3610:20: warning: initialization from incompatible pointer type
  .change_station = cfg80211_rtw_change_station,
                    ^
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3610:20: warning: (near initialization for ‘rtw_cfg80211_ops.change_station’)
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3617:13: warning: initialization from incompatible pointer type
  .mgmt_tx = cfg80211_rtw_mgmt_tx,
             ^
backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3617:13: warning: (near initialization for ‘rtw_cfg80211_ops.mgmt_tx’)
net/rfkill/rfkill-regulator.c: In function ‘rfkill_regulator_set_block’:
net/rfkill/rfkill-regulator.c:43:4: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]
    regulator_enable(rfkill_data->vcc);
    ^
drivers/media/platform/exynos/mfc/s5p_mfc.c:2108:28: warning: ‘s5p_mfc_dec_drm_videodev’ defined but not used [-Wunused-variable]
 static struct video_device s5p_mfc_dec_drm_videodev = {
                            ^
drivers/media/platform/exynos/mfc/s5p_mfc.c:2115:28: warning: ‘s5p_mfc_enc_drm_videodev’ defined but not used [-Wunused-variable]
 static struct video_device s5p_mfc_enc_drm_videodev = {
                            ^
fs/binfmt_misc.c: In function ‘parse_command.part.1’:
fs/binfmt_misc.c:405:7: warning: array subscript is above array bounds [-Warray-bounds]
  if (s[count-1] == '\n')
       ^
drivers/usb/host/xhci.c: In function ‘xhci_free_dev’:
drivers/usb/host/xhci.c:3506:17: warning: unused variable ‘dev’ [-Wunused-variable]
  struct device *dev = hcd->self.controller;
                 ^
drivers/usb/host/xhci.c: In function ‘xhci_alloc_dev’:
drivers/usb/host/xhci.c:3592:17: warning: unused variable ‘dev’ [-Wunused-variable]
  struct device *dev = hcd->self.controller;
                 ^
drivers/usb/host/xhci-plat.c: In function ‘xhci_plat_probe’:
drivers/usb/host/xhci-plat.c:156:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    extern void samsung_usb3phy_retune(int);
    ^
arch/arm/boot/compressed/atags_to_fdt.c: In function ‘merge_fdt_bootargs’:
arch/arm/boot/compressed/atags_to_fdt.c:96:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^

Change-Id: I646d4470fecdef67da42bcff549a2dc3632c68cd
parent 621e9fab
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include <linux/version.h> #include <linux/version.h>
#include <generated/utsrelease.h> #include <generated/utsrelease.h>
struct device;
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
struct dentry *parent, struct dentry *parent,
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
*/ */
#include <linux/string.h> #include <linux/string.h>
struct device;
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
/* backport /* backport
* commit 9f3b795a626ee79574595e06d1437fe0c7d51d29 * commit 9f3b795a626ee79574595e06d1437fe0c7d51d29
......
...@@ -910,7 +910,7 @@ PHY_RFShadowCompareAll( ...@@ -910,7 +910,7 @@ PHY_RFShadowCompareAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++) for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{ {
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++) for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{ {
PHY_RFShadowCompare(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset); PHY_RFShadowCompare(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset);
} }
...@@ -928,7 +928,7 @@ PHY_RFShadowRecorverAll( ...@@ -928,7 +928,7 @@ PHY_RFShadowRecorverAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++) for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{ {
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++) for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{ {
PHY_RFShadowRecorver(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset); PHY_RFShadowRecorver(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset);
} }
...@@ -972,7 +972,7 @@ PHY_RFShadowCompareFlagSetAll( ...@@ -972,7 +972,7 @@ PHY_RFShadowCompareFlagSetAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++) for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{ {
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++) for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{ {
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!! // 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
if (Offset != 0x26 && Offset != 0x27) if (Offset != 0x26 && Offset != 0x27)
...@@ -994,7 +994,7 @@ PHY_RFShadowRecorverFlagSetAll( ...@@ -994,7 +994,7 @@ PHY_RFShadowRecorverFlagSetAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++) for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{ {
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++) for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{ {
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!! // 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
if (Offset != 0x26 && Offset != 0x27) if (Offset != 0x26 && Offset != 0x27)
...@@ -1015,7 +1015,7 @@ PHY_RFShadowRefresh( ...@@ -1015,7 +1015,7 @@ PHY_RFShadowRefresh(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++) for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{ {
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++) for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{ {
RF_Shadow[eRFPath][Offset].Value = 0; RF_Shadow[eRFPath][Offset].Value = 0;
RF_Shadow[eRFPath][Offset].Compare = _FALSE; RF_Shadow[eRFPath][Offset].Compare = _FALSE;
......
...@@ -1228,15 +1228,9 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, ...@@ -1228,15 +1228,9 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
return 0; return 0;
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14,0))
static int cfg80211_rtw_get_station(struct wiphy *wiphy, static int cfg80211_rtw_get_station(struct wiphy *wiphy,
struct net_device *ndev, struct net_device *ndev,
const u8 *mac, struct station_info *sinfo) const u8 *mac, struct station_info *sinfo)
#else
static int cfg80211_rtw_get_station(struct wiphy *wiphy,
struct net_device *ndev,
u8 *mac, struct station_info *sinfo)
#endif
{ {
int ret = 0; int ret = 0;
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy); struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
...@@ -2963,29 +2957,16 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ...@@ -2963,29 +2957,16 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14,0))
static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac, struct station_parameters *params) const u8 *mac, struct station_parameters *params)
#else
static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac, struct station_parameters *params)
#endif
{ {
DBG_8192D(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); DBG_8192D(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0; return 0;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
struct station_del_parameters *params)
#elif (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0))
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac)
#else
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac) struct station_del_parameters *params)
#endif
{ {
int ret=0; int ret=0;
struct list_head *phead, *plist; struct list_head *phead, *plist;
...@@ -2994,9 +2975,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev ...@@ -2994,9 +2975,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
struct rtw_adapter *padapter = (struct rtw_adapter *)rtw_netdev_priv(ndev); struct rtw_adapter *padapter = (struct rtw_adapter *)rtw_netdev_priv(ndev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
const u8 *mac = params->mac; const u8 *mac = params->mac;
#endif
DBG_8192D("+"FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); DBG_8192D("+"FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
...@@ -3070,13 +3049,8 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev ...@@ -3070,13 +3049,8 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
return ret; return ret;
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0))
static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac, struct station_parameters *params) const u8 *mac, struct station_parameters *params)
#else
static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac, struct station_parameters *params)
#endif
{ {
DBG_8192D(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); DBG_8192D(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
...@@ -3506,18 +3480,8 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, ...@@ -3506,18 +3480,8 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len,
return ret; return ret;
} }
int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_channel *chan, bool offchan,
unsigned int wait, const u8 *buf, size_t len,
bool no_cck, bool dont_wait_for_ack, u64 *cookie);
static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
struct ieee80211_channel *chan, bool offchan,
unsigned int wait, const u8 *buf, size_t len,
bool no_cck, bool dont_wait_for_ack,
#else
struct cfg80211_mgmt_tx_params *params, struct cfg80211_mgmt_tx_params *params,
#endif
u64 *cookie) u64 *cookie)
{ {
struct rtw_adapter *padapter = struct rtw_adapter *padapter =
...@@ -3529,11 +3493,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -3529,11 +3493,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
bool ack = true; bool ack = true;
u8 category, action; u8 category, action;
unsigned long start = jiffies; unsigned long start = jiffies;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
size_t len = params->len; size_t len = params->len;
struct ieee80211_channel *chan = params->chan; struct ieee80211_channel *chan = params->chan;
const u8 *buf = params->buf; const u8 *buf = params->buf;
#endif
struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *)buf; struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *)buf;
u8 tx_ch = (u8) ieee80211_frequency_to_channel(chan->center_freq); u8 tx_ch = (u8) ieee80211_frequency_to_channel(chan->center_freq);
......
...@@ -801,8 +801,8 @@ static ssize_t show_target_loads( ...@@ -801,8 +801,8 @@ static ssize_t show_target_loads(
for (i = 0; i < tunables->ntarget_loads; i++) for (i = 0; i < tunables->ntarget_loads; i++)
ret += sprintf(buf + ret, "%u%s", tunables->target_loads[i], ret += sprintf(buf + ret, "%u%s", tunables->target_loads[i],
i & 0x1 ? ":" : " "); i & 0x1 ? ":" : " ");
ret--;
ret += sprintf(buf + --ret, "\n"); ret += sprintf(buf + ret, "\n");
spin_unlock_irqrestore(&tunables->target_loads_lock, flags); spin_unlock_irqrestore(&tunables->target_loads_lock, flags);
return ret; return ret;
} }
...@@ -842,7 +842,8 @@ static ssize_t show_above_hispeed_delay( ...@@ -842,7 +842,8 @@ static ssize_t show_above_hispeed_delay(
tunables->above_hispeed_delay[i], tunables->above_hispeed_delay[i],
i & 0x1 ? ":" : " "); i & 0x1 ? ":" : " ");
ret += sprintf(buf + --ret, "\n"); ret--;
ret += sprintf(buf + ret, "\n");
spin_unlock_irqrestore(&tunables->above_hispeed_delay_lock, flags); spin_unlock_irqrestore(&tunables->above_hispeed_delay_lock, flags);
return ret; return ret;
} }
......
...@@ -942,7 +942,7 @@ static int exynos5_int_busfreq_target(struct device *dev, ...@@ -942,7 +942,7 @@ static int exynos5_int_busfreq_target(struct device *dev,
unsigned long freq; unsigned long freq;
unsigned long old_freq; unsigned long old_freq;
unsigned long target_volt; unsigned long target_volt;
int i, target_idx = LV_0; int target_idx = LV_0;
bool set_abb_first_than_volt; bool set_abb_first_than_volt;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -1117,7 +1117,7 @@ static ssize_t int_show_state(struct device *dev, struct device_attribute *attr, ...@@ -1117,7 +1117,7 @@ static ssize_t int_show_state(struct device *dev, struct device_attribute *attr,
ssize_t len = 0; ssize_t len = 0;
ssize_t write_cnt = (ssize_t)((PAGE_SIZE / LV_END) - 2); ssize_t write_cnt = (ssize_t)((PAGE_SIZE / LV_END) - 2);
for (i = LV_0; i < LV_END; i++) for (i = LV_0; i < ARRAY_SIZE(int_bus_opp_list); i++)
len += snprintf(buf + len, write_cnt, "%ld %llu\n", int_bus_opp_list[i].freq, len += snprintf(buf + len, write_cnt, "%ld %llu\n", int_bus_opp_list[i].freq,
(unsigned long long)int_bus_opp_list[i].time_in_state); (unsigned long long)int_bus_opp_list[i].time_in_state);
...@@ -1238,7 +1238,7 @@ static int exynos5_devfreq_int_probe(struct platform_device *pdev) ...@@ -1238,7 +1238,7 @@ static int exynos5_devfreq_int_probe(struct platform_device *pdev)
struct clk *tmp_clk = NULL, *tmp_parent_clk = NULL, *tmp_p_parent_clk = NULL; struct clk *tmp_clk = NULL, *tmp_parent_clk = NULL, *tmp_p_parent_clk = NULL;
struct int_pm_clks *int_clk; struct int_pm_clks *int_clk;
unsigned long volt; unsigned long volt;
int i, index = -1; int index = -1;
data = kzalloc(sizeof(struct busfreq_data_int), GFP_KERNEL); data = kzalloc(sizeof(struct busfreq_data_int), GFP_KERNEL);
......
...@@ -765,8 +765,10 @@ static int exynos_drm_init(void) ...@@ -765,8 +765,10 @@ static int exynos_drm_init(void)
return 0; return 0;
#ifdef CONFIG_DRM_EXYNOS_VIDI
err_unregister_pd: err_unregister_pd:
platform_device_unregister(exynos_drm_pdev); platform_device_unregister(exynos_drm_pdev);
#endif
err_remove_vidi: err_remove_vidi:
#ifdef CONFIG_DRM_EXYNOS_VIDI #ifdef CONFIG_DRM_EXYNOS_VIDI
......
...@@ -226,7 +226,7 @@ struct hdmiphy_config { ...@@ -226,7 +226,7 @@ struct hdmiphy_config {
// Default gEnableHPD = true, // Default gEnableHPD = true,
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
unsigned int gEnableHPD = true; // Default setup unsigned long gEnableHPD = true; // Default setup
static int __init hdmi_hpd_enable(char *line) static int __init hdmi_hpd_enable(char *line)
{ {
...@@ -1757,7 +1757,9 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata) ...@@ -1757,7 +1757,9 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata)
} }
clk_disable_unprepare(hdata->res.sclk_hdmi); clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy); #ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi); clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */ /* enable HDMI and timing generator */
...@@ -1919,7 +1921,9 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata) ...@@ -1919,7 +1921,9 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
} }
clk_disable_unprepare(hdata->res.sclk_hdmi); clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy); #ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi); clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */ /* enable HDMI and timing generator */
...@@ -1940,7 +1944,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) ...@@ -1940,7 +1944,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
u32 reg; u32 reg;
clk_disable_unprepare(hdata->res.sclk_hdmi); clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel); #ifndef CONFIG_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi); clk_prepare_enable(hdata->res.sclk_hdmi);
/* operation mode */ /* operation mode */
...@@ -1982,6 +1988,7 @@ static void hdmiphy_poweron(struct hdmi_context *hdata) ...@@ -1982,6 +1988,7 @@ static void hdmiphy_poweron(struct hdmi_context *hdata)
hdmiphy_conf_reset(hdata); hdmiphy_conf_reset(hdata);
} }
#ifndef CONFIG_MACH_ODROIDXU3
static void hdmiphy_poweroff(struct hdmi_context *hdata) static void hdmiphy_poweroff(struct hdmi_context *hdata)
{ {
if (hdata->type != HDMI_TYPE14) if (hdata->type != HDMI_TYPE14)
...@@ -2003,6 +2010,7 @@ static void hdmiphy_poweroff(struct hdmi_context *hdata) ...@@ -2003,6 +2010,7 @@ static void hdmiphy_poweroff(struct hdmi_context *hdata)
hdmiphy_reg_writeb(hdata, HDMIPHY_MODE_SET_DONE, hdmiphy_reg_writeb(hdata, HDMIPHY_MODE_SET_DONE,
HDMI_PHY_DISABLE_MODE_SET); HDMI_PHY_DISABLE_MODE_SET);
} }
#endif
static void hdmiphy_conf_apply(struct hdmi_context *hdata) static void hdmiphy_conf_apply(struct hdmi_context *hdata)
{ {
...@@ -2349,12 +2357,16 @@ static void hdmi_poweroff(struct exynos_drm_display *display) ...@@ -2349,12 +2357,16 @@ static void hdmi_poweroff(struct exynos_drm_display *display)
/* HDMI System Disable */ /* HDMI System Disable */
hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN); hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN);
// hdmiphy_poweroff(hdata); #ifndef CONFIG_MACH_ODROIDXU3
hdmiphy_poweroff(hdata);
#endif
cancel_delayed_work(&hdata->hotplug_work); cancel_delayed_work(&hdata->hotplug_work);
// clk_disable_unprepare(res->sclk_hdmi); #ifndef CONFIG_MACH_ODROIDXU3
// clk_disable_unprepare(res->hdmi); clk_disable_unprepare(res->sclk_hdmi);
clk_disable_unprepare(res->hdmi);
#endif
/* reset pmu hdmiphy control bit to disable hdmiphy */ /* reset pmu hdmiphy control bit to disable hdmiphy */
regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL, regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL,
...@@ -2473,7 +2485,9 @@ static int hdmi_resources_init(struct hdmi_context *hdata) ...@@ -2473,7 +2485,9 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
goto fail; goto fail;
} }
// clk_set_parent(res->mout_hdmi, res->sclk_pixel); #ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(res->mout_hdmi, res->sclk_pixel);
#endif
clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy); clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy);
res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) * res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
......
...@@ -54,6 +54,8 @@ static struct ioboard_spi *ioboard_spi; ...@@ -54,6 +54,8 @@ static struct ioboard_spi *ioboard_spi;
#define CMD_HIGH_SPEED_READ 0x0B #define CMD_HIGH_SPEED_READ 0x0B
#define CMD_READ_STATUS_REG 0x05 #define CMD_READ_STATUS_REG 0x05
#define SPI_READ_HIGHSPEED
// Erase memory // Erase memory
#define CMD_ERASE_4KB 0x20 #define CMD_ERASE_4KB 0x20
#define CMD_ERASE_32KB 0x52 #define CMD_ERASE_32KB 0x52
...@@ -196,7 +198,7 @@ static int ioboard_spi_byte_write (struct spi_device *spi, unsigned int addr, ...@@ -196,7 +198,7 @@ static int ioboard_spi_byte_write (struct spi_device *spi, unsigned int addr,
return 0; return 0;
} }
#ifdef SPI_READ_HIGHSPEED
//[*]--------------------------------------------------------------------------------------------------[*] //[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size) static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
{ {
...@@ -218,7 +220,7 @@ static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigne ...@@ -218,7 +220,7 @@ static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigne
return 0; return 0;
} }
#else
//[*]--------------------------------------------------------------------------------------------------[*] //[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_read_memory (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size) static int ioboard_spi_read_memory (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
{ {
...@@ -239,6 +241,7 @@ static int ioboard_spi_read_memory (struct spi_device *spi, unsigne ...@@ -239,6 +241,7 @@ static int ioboard_spi_read_memory (struct spi_device *spi, unsigne
return 0; return 0;
} }
#endif
//[*]--------------------------------------------------------------------------------------------------[*] //[*]--------------------------------------------------------------------------------------------------[*]
int ioboard_spi_read (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size) int ioboard_spi_read (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
...@@ -249,12 +252,20 @@ int ioboard_spi_read (struct spi_device *spi, unsigned int addr, unsigned cha ...@@ -249,12 +252,20 @@ int ioboard_spi_read (struct spi_device *spi, unsigned int addr, unsigned cha
na = size % SPI_MAX_BUFFER_SIZE; na = size % SPI_MAX_BUFFER_SIZE;
while(mok) { while(mok) {
#ifdef SPI_READ_HIGHSPEED
ioboard_spi_read_memory_highspeed(spi, addr + offset, &rdata[offset], SPI_MAX_BUFFER_SIZE); ioboard_spi_read_memory_highspeed(spi, addr + offset, &rdata[offset], SPI_MAX_BUFFER_SIZE);
#else
ioboard_spi_read_memory(spi, addr + offset, &rdata[offset], SPI_MAX_BUFFER_SIZE);
#endif
offset += SPI_MAX_BUFFER_SIZE; mok = mok - 1; offset += SPI_MAX_BUFFER_SIZE; mok = mok - 1;
} }
if(na) { if(na) {
#ifdef SPI_READ_HIGHSPEED
ioboard_spi_read_memory_highspeed(spi, addr + offset, &rdata[offset], na); ioboard_spi_read_memory_highspeed(spi, addr + offset, &rdata[offset], na);
#else
ioboard_spi_read_memory(spi, addr + offset, &rdata[offset], na);
#endif
} }
return 0; return 0;
...@@ -326,6 +337,7 @@ static void ioboard_spi_wp_disable (unsigned char disable) ...@@ -326,6 +337,7 @@ static void ioboard_spi_wp_disable (unsigned char disable)
} }
//[*]--------------------------------------------------------------------------------------------------[*] //[*]--------------------------------------------------------------------------------------------------[*]
#ifdef CONFIG_ODROID_EXYNOS5_IOBOARD_DEBUG
static void ioboard_spi_test (struct spi_device *spi) static void ioboard_spi_test (struct spi_device *spi)
{ {
unsigned char wdata[64], rdata[64]; unsigned char wdata[64], rdata[64];
...@@ -367,6 +379,7 @@ static void ioboard_spi_test (struct spi_device *spi) ...@@ -367,6 +379,7 @@ static void ioboard_spi_test (struct spi_device *spi)
pr_info("[0x%02X] ", rdata[i]); pr_info("[0x%02X] ", rdata[i]);
} }
} }
#endif
//[*]--------------------------------------------------------------------------------------------------[*] //[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_probe (struct spi_device *spi) static int ioboard_spi_probe (struct spi_device *spi)
...@@ -396,7 +409,7 @@ static int ioboard_spi_probe (struct spi_device *spi) ...@@ -396,7 +409,7 @@ static int ioboard_spi_probe (struct spi_device *spi)
goto err; goto err;
} }
#if defined(CONFIG_ODROID_EXYNOS5_IOBOARD_DEBUG) #if defined(CONFIG_ODROID_EXYNOS5_IOBOARD_DEBUG)
ioboard_spi_test(spi); ioboard_spi_test(spi);
#endif #endif
......
...@@ -256,7 +256,7 @@ out: ...@@ -256,7 +256,7 @@ out:
return 0; return 0;
} }
static void appleir_input_configured(struct hid_device *hid, static int appleir_input_configured(struct hid_device *hid,
struct hid_input *hidinput) struct hid_input *hidinput)
{ {
struct input_dev *input_dev = hidinput->input; struct input_dev *input_dev = hidinput->input;
...@@ -275,6 +275,8 @@ static void appleir_input_configured(struct hid_device *hid, ...@@ -275,6 +275,8 @@ static void appleir_input_configured(struct hid_device *hid,
for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++) for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++)
set_bit(appleir->keymap[i], input_dev->keybit); set_bit(appleir->keymap[i], input_dev->keybit);
clear_bit(KEY_RESERVED, input_dev->keybit); clear_bit(KEY_RESERVED, input_dev->keybit);
return 0;
} }
static int appleir_input_mapping(struct hid_device *hid, static int appleir_input_mapping(struct hid_device *hid,
......
...@@ -471,18 +471,22 @@ static int magicmouse_input_mapping(struct hid_device *hdev, ...@@ -471,18 +471,22 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
return 0; return 0;
} }
static void magicmouse_input_configured(struct hid_device *hdev, static int magicmouse_input_configured(struct hid_device *hdev,
struct hid_input *hi) struct hid_input *hi)
{ {
struct magicmouse_sc *msc = hid_get_drvdata(hdev); struct magicmouse_sc *msc = hid_get_drvdata(hdev);
int ret;
int ret = magicmouse_setup_input(msc->input, hdev); ret = magicmouse_setup_input(msc->input, hdev);
if (ret) { if (ret) {
hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
/* clean msc->input to notify probe() of the failure */ /* clean msc->input to notify probe() of the failure */
msc->input = NULL; msc->input = NULL;
return ret;
} }
return 0;
} }
......
...@@ -859,14 +859,14 @@ not_claimed_input: ...@@ -859,14 +859,14 @@ not_claimed_input:
return 1; return 1;
} }
static void ntrig_input_configured(struct hid_device *hid, static int ntrig_input_configured(struct hid_device *hid,
struct hid_input *hidinput) struct hid_input *hidinput)
{ {
struct input_dev *input = hidinput->input; struct input_dev *input = hidinput->input;
if (hidinput->report->maxfield < 1) if (hidinput->report->maxfield < 1)
return; return 0;
switch (hidinput->report->field[0]->application) { switch (hidinput->report->field[0]->application) {
case HID_DG_PEN: case HID_DG_PEN:
...@@ -890,6 +890,8 @@ static void ntrig_input_configured(struct hid_device *hid, ...@@ -890,6 +890,8 @@ static void ntrig_input_configured(struct hid_device *hid,
"N-Trig MultiTouch"; "N-Trig MultiTouch";
break; break;
} }
return 0;
} }
static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
......
...@@ -2105,6 +2105,7 @@ static struct video_device s5p_mfc_enc_videodev = { ...@@ -2105,6 +2105,7 @@ static struct video_device s5p_mfc_enc_videodev = {
.release = video_device_release, .release = video_device_release,
}; };
#ifndef CONFIG_MACH_ODROIDXU3
static struct video_device s5p_mfc_dec_drm_videodev = { static struct video_device s5p_mfc_dec_drm_videodev = {
.name = S5P_MFC_DEC_DRM_NAME, .name = S5P_MFC_DEC_DRM_NAME,
.fops = &s5p_mfc_fops, .fops = &s5p_mfc_fops,
...@@ -2118,6 +2119,7 @@ static struct video_device s5p_mfc_enc_drm_videodev = { ...@@ -2118,6 +2119,7 @@ static struct video_device s5p_mfc_enc_drm_videodev = {
.minor = -1, .minor = -1,
.release = video_device_release, .release = video_device_release,
}; };
#endif
static void *mfc_get_drv_data(struct platform_device *pdev);