summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-07-02 10:59:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-07-02 10:59:37 +0200
commitf22d4e27786c8a7f58ef7167f38c3c5dd313d290 (patch)
treea0f02af6952b17650642ceee110bc063347eea2e
parent6e4b15537b522fc6d393d664c12f40b4a00b5ef6 (diff)
parent1bb01712a717a2008efce4f76a3d8e43e4435eb3 (diff)
downloadbarebox-f22d4e27786c8a7f58ef7167f38c3c5dd313d290.tar.gz
barebox-f22d4e27786c8a7f58ef7167f38c3c5dd313d290.tar.xz
Merge branch 'for-next/sparse'
-rw-r--r--arch/arm/mach-imx/clocksource.c12
-rw-r--r--arch/arm/mach-imx/include/mach/clock.h2
-rw-r--r--arch/arm/mach-imx/speed-imx35.c2
-rw-r--r--arch/arm/mach-imx/speed-imx51.c5
-rw-r--r--arch/arm/mach-imx/speed-imx53.c3
-rw-r--r--common/oftree.c2
-rw-r--r--common/tlsf.c12
-rw-r--r--drivers/base/driver.c6
-rw-r--r--drivers/mci/imx-esdhc.c20
-rw-r--r--drivers/mtd/ubi/ubi-barebox.h1
-rw-r--r--drivers/net/smc911x.c2
-rw-r--r--drivers/usb/gadget/fsl_udc.c2
-rw-r--r--drivers/usb/host/ohci-hcd.c40
-rw-r--r--drivers/usb/host/ohci.h2
-rw-r--r--fs/fat/ff.c10
-rw-r--r--include/driver.h2
-rw-r--r--include/linux/compiler.h2
-rw-r--r--include/qsort.h2
18 files changed, 54 insertions, 73 deletions
diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c
index 4f5895c2a5..4e77ece7f3 100644
--- a/arch/arm/mach-imx/clocksource.c
+++ b/arch/arm/mach-imx/clocksource.c
@@ -38,7 +38,7 @@
#include <io.h>
#define GPT(x) __REG(IMX_TIM1_BASE + (x))
-#define timer_base (IMX_TIM1_BASE)
+#define timer_base IOMEM(IMX_TIM1_BASE)
static uint64_t imx_clocksource_read(void)
{
@@ -120,15 +120,17 @@ core_initcall(clocksource_init);
*/
void __noreturn reset_cpu (unsigned long addr)
{
+ void __iomem *wdt = IOMEM(IMX_WDT_BASE);
+
/* Disable watchdog and set Time-Out field to 0 */
- writew(0x0, IMX_WDT_BASE + WDOG_WCR);
+ writew(0x0, wdt + WDOG_WCR);
/* Write Service Sequence */
- writew(0x5555, IMX_WDT_BASE + WDOG_WSR);
- writew(0xaaaa, IMX_WDT_BASE + WDOG_WSR);
+ writew(0x5555, wdt + WDOG_WSR);
+ writew(0xaaaa, wdt + WDOG_WSR);
/* Enable watchdog */
- writew(WDOG_WCR_WDE, IMX_WDT_BASE + WDOG_WCR);
+ writew(WDOG_WCR_WDE, wdt + WDOG_WCR);
while (1);
/*NOTREACHED*/
diff --git a/arch/arm/mach-imx/include/mach/clock.h b/arch/arm/mach-imx/include/mach/clock.h
index 10821782fe..060d265d5e 100644
--- a/arch/arm/mach-imx/include/mach/clock.h
+++ b/arch/arm/mach-imx/include/mach/clock.h
@@ -30,6 +30,8 @@ ulong imx_get_lcdclk(void);
ulong imx_get_i2cclk(void);
ulong imx_get_mmcclk(void);
ulong imx_get_cspiclk(void);
+ulong imx_get_ipgclk(void);
+ulong imx_get_usbclk(void);
int imx_clko_set_div(int div);
void imx_clko_set_src(int src);
diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c
index 1e1c39ff82..2bdcc07100 100644
--- a/arch/arm/mach-imx/speed-imx35.c
+++ b/arch/arm/mach-imx/speed-imx35.c
@@ -84,7 +84,7 @@ unsigned long imx_get_ahbclk(void)
return fref / aad->ahb;
}
-static unsigned long imx_get_ipgclk(void)
+unsigned long imx_get_ipgclk(void)
{
ulong clk = imx_get_ahbclk();
diff --git a/arch/arm/mach-imx/speed-imx51.c b/arch/arm/mach-imx/speed-imx51.c
index 8d1ecf3e40..1c3523da55 100644
--- a/arch/arm/mach-imx/speed-imx51.c
+++ b/arch/arm/mach-imx/speed-imx51.c
@@ -2,11 +2,12 @@
#include <io.h>
#include <asm-generic/div64.h>
#include <mach/imx51-regs.h>
+#include <mach/clock.h>
#include <mach/clock-imx51_53.h>
static u32 ccm_readl(u32 ofs)
{
- return readl(MX51_CCM_BASE_ADDR + ofs);
+ return readl(IOMEM(MX51_CCM_BASE_ADDR) + ofs);
}
static unsigned long ckil_get_rate(void)
@@ -142,7 +143,7 @@ unsigned long imx_get_uartclk(void)
return parent_rate / (prediv * podf);
}
-static unsigned long imx_get_ahbclk(void)
+unsigned long imx_get_ahbclk(void)
{
u32 reg, div;
diff --git a/arch/arm/mach-imx/speed-imx53.c b/arch/arm/mach-imx/speed-imx53.c
index 634341e738..653dae33b6 100644
--- a/arch/arm/mach-imx/speed-imx53.c
+++ b/arch/arm/mach-imx/speed-imx53.c
@@ -2,6 +2,7 @@
#include <io.h>
#include <asm-generic/div64.h>
#include <mach/imx-regs.h>
+#include <mach/clock.h>
#include "mach/clock-imx51_53.h"
static u32 ccm_readl(u32 ofs)
@@ -139,7 +140,7 @@ unsigned long imx_get_uartclk(void)
return parent_rate / (prediv * podf);
}
-static unsigned long imx_get_ahbclk(void)
+unsigned long imx_get_ahbclk(void)
{
u32 reg, div;
diff --git a/common/oftree.c b/common/oftree.c
index 49758a9ddf..677e934a98 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -207,7 +207,7 @@ int fdt_find_and_setprop(struct fdt_header *fdt, const char *node,
if (nodeoff < 0)
return nodeoff;
- if ((!create) && (fdt_get_property(fdt, nodeoff, prop, 0) == NULL))
+ if ((!create) && (fdt_get_property(fdt, nodeoff, prop, NULL) == NULL))
return 0; /* create flag not set; so exit quietly */
return fdt_setprop(fdt, nodeoff, prop, val, len);
diff --git a/common/tlsf.c b/common/tlsf.c
index c810e8dafe..9515ac764c 100644
--- a/common/tlsf.c
+++ b/common/tlsf.c
@@ -367,7 +367,7 @@ static block_header_t* search_suitable_block(pool_t* pool, int* fli, int* sli)
if (!fl_map)
{
/* No free blocks available, memory has been exhausted. */
- return 0;
+ return NULL;
}
fl = tlsf_ffs(fl_map);
@@ -563,7 +563,7 @@ static block_header_t* block_trim_free_leading(pool_t* pool, block_header_t* blo
static block_header_t* block_locate_free(pool_t* pool, size_t size)
{
int fl = 0, sl = 0;
- block_header_t* block = 0;
+ block_header_t* block = NULL;
if (size)
{
@@ -582,7 +582,7 @@ static block_header_t* block_locate_free(pool_t* pool, size_t size)
static void* block_prepare_used(pool_t* pool, block_header_t* block, size_t size)
{
- void* p = 0;
+ void* p = NULL;
if (block)
{
block_trim_free(pool, block, size);
@@ -737,7 +737,7 @@ size_t tlsf_block_size(void* ptr)
** tlsf_create, equal to the size of a pool_t plus overhead of the initial
** free block and the sentinel block.
*/
-size_t tlsf_overhead()
+size_t tlsf_overhead(void)
{
const size_t pool_overhead = sizeof(pool_t) + 2 * block_header_overhead;
return pool_overhead;
@@ -790,7 +790,7 @@ tlsf_pool tlsf_create(void* mem, size_t bytes)
(unsigned int)(pool_overhead + block_size_min),
(unsigned int)(pool_overhead + block_size_max));
#endif
- return 0;
+ return NULL;
}
/* Construct a valid pool object. */
@@ -915,7 +915,7 @@ void tlsf_free(tlsf_pool tlsf, void* ptr)
void* tlsf_realloc(tlsf_pool tlsf, void* ptr, size_t size)
{
pool_t* pool = tlsf_cast(pool_t*, tlsf);
- void* p = 0;
+ void* p = NULL;
/* Zero-size requests are treated as free. */
if (ptr && size == 0)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index a5c6fb9293..55dbf476ac 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -241,15 +241,15 @@ static struct resource *dev_get_resource(struct device_d *dev, int num)
return NULL;
}
-void __iomem *dev_get_mem_region(struct device_d *dev, int num)
+void *dev_get_mem_region(struct device_d *dev, int num)
{
struct resource *res;
res = dev_get_resource(dev, num);
if (!res)
- return res;
+ return NULL;
- return (void __force __iomem *)res->start;
+ return (void __force *)res->start;
}
EXPORT_SYMBOL(dev_get_mem_region);
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index ae3c805997..585cab9e54 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -70,7 +70,7 @@ struct fsl_esdhc {
struct fsl_esdhc_host {
struct mci_host mci;
- struct fsl_esdhc *regs;
+ struct fsl_esdhc __iomem *regs;
u32 no_snoop;
unsigned long cur_clock;
struct device_d *dev;
@@ -81,7 +81,7 @@ struct fsl_esdhc_host {
#define SDHCI_CMD_ABORTCMD (0xC0 << 16)
/* Return the XFERTYP flags for a given command and data packet */
-u32 esdhc_xfertyp(struct mci_cmd *cmd, struct mci_data *data)
+static u32 esdhc_xfertyp(struct mci_cmd *cmd, struct mci_data *data)
{
u32 xfertyp = 0;
@@ -185,7 +185,7 @@ esdhc_pio_read_write(struct mci_host *mci, struct mci_data *data)
static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data)
{
struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
- struct fsl_esdhc *regs = host->regs;
+ struct fsl_esdhc __iomem *regs = host->regs;
#ifndef CONFIG_MCI_IMX_ESDHC_PIO
u32 wml_value;
@@ -237,7 +237,7 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data)
u32 xfertyp, mixctrl;
u32 irqstat;
struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
- struct fsl_esdhc *regs = host->regs;
+ struct fsl_esdhc __iomem *regs = host->regs;
int ret;
esdhc_write32(&regs->irqstat, -1);
@@ -353,11 +353,11 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data)
return 0;
}
-void set_sysctl(struct mci_host *mci, u32 clock)
+static void set_sysctl(struct mci_host *mci, u32 clock)
{
int div, pre_div;
struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
- struct fsl_esdhc *regs = host->regs;
+ struct fsl_esdhc __iomem *regs = host->regs;
int sdhc_clk = imx_get_mmcclk();
u32 clk;
@@ -400,7 +400,7 @@ void set_sysctl(struct mci_host *mci, u32 clock)
static void esdhc_set_ios(struct mci_host *mci, struct mci_ios *ios)
{
struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
- struct fsl_esdhc *regs = host->regs;
+ struct fsl_esdhc __iomem *regs = host->regs;
/* Set the clock speed */
set_sysctl(mci, ios->clock);
@@ -425,7 +425,7 @@ static void esdhc_set_ios(struct mci_host *mci, struct mci_ios *ios)
static int esdhc_card_detect(struct fsl_esdhc_host *host)
{
- struct fsl_esdhc *regs = host->regs;
+ struct fsl_esdhc __iomem *regs = host->regs;
struct esdhc_platform_data *pdata = host->dev->platform_data;
int ret;
@@ -451,7 +451,7 @@ static int esdhc_card_detect(struct fsl_esdhc_host *host)
static int esdhc_init(struct mci_host *mci, struct device_d *dev)
{
struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
- struct fsl_esdhc *regs = host->regs;
+ struct fsl_esdhc __iomem *regs = host->regs;
int timeout = 1000;
int ret = 0;
@@ -493,7 +493,7 @@ static int esdhc_init(struct mci_host *mci, struct device_d *dev)
return ret;
}
-static int esdhc_reset(struct fsl_esdhc *regs)
+static int esdhc_reset(struct fsl_esdhc __iomem *regs)
{
uint64_t start;
diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h
index d23228f648..72f29a61e7 100644
--- a/drivers/mtd/ubi/ubi-barebox.h
+++ b/drivers/mtd/ubi/ubi-barebox.h
@@ -135,7 +135,6 @@ struct kmem_cache { int i; };
#define GFP_KERNEL 0
#define GFP_NOFS 1
-#define __user
#define __init
#define __exit
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 800c1886ce..7dddbbcc38 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -691,7 +691,7 @@ static int smc911x_probe(struct device_d *dev)
struct smc911x_priv *priv;
uint32_t val;
int i;
- void *base;
+ void __iomem *base;
base = dev_request_mem_region(dev, 0);
diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c
index 627e4177d6..5537a0eb97 100644
--- a/drivers/usb/gadget/fsl_udc.c
+++ b/drivers/usb/gadget/fsl_udc.c
@@ -519,7 +519,7 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length)
* 2 + ((windex & USB_DIR_IN) ? 1 : 0))
#define get_pipe_by_ep(EP) (ep_index(EP) * 2 + ep_is_in(EP))
-static struct usb_dr_device *dr_regs;
+static struct usb_dr_device __iomem *dr_regs;
static struct fsl_udc *udc_controller = NULL;
static const struct usb_endpoint_descriptor
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 05e4094386..f10d827615 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -415,7 +415,7 @@ static void ohci_dump(struct ohci *controller, int verbose)
/* get a transfer request */
-int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup)
+static int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup)
{
struct ed *ed;
int i, size = 0;
@@ -498,7 +498,7 @@ int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup)
static inline int sohci_return_job(struct ohci *hc, struct urb_priv *urb)
{
#ifdef ENBALE_PIPE_INTERRUPT
- struct ohci_regs *regs = hc->regs;
+ struct ohci_regs __iomem *regs = hc->regs;
#endif
switch (usb_pipetype(urb->pipe)) {
@@ -848,7 +848,7 @@ static void td_fill(struct ohci *ohci, unsigned int info,
}
#endif
if (!len)
- data = 0;
+ data = NULL;
td->hwINFO = m32_swap(info);
td->hwCBP = virt_to_phys((void *)m32_swap((unsigned long)data));
@@ -894,7 +894,7 @@ static void td_submit_job(struct usb_device *dev, unsigned long pipe,
if (data_len)
data = buffer;
else
- data = 0;
+ data = NULL;
switch (usb_pipetype(pipe)) {
case PIPE_BULK:
@@ -1214,32 +1214,6 @@ static inline void wr_rh_portstat(struct ohci *ohci, int wIndex, __u32 value)
writel(value, &ohci->regs->roothub.portstatus[wIndex-1]);
}
-/* request to virtual root hub */
-
-int rh_check_port_status(struct ohci *controller)
-{
- __u32 temp, ndp, i;
- int res;
-
- res = -1;
- temp = roothub_a(controller);
- ndp = (temp & RH_A_NDP);
-#ifdef CONFIG_AT91C_PQFP_UHPBUG
- ndp = (ndp == 2) ? 1 : 0;
-#endif
- for (i = 0; i < ndp; i++) {
- temp = roothub_portstatus(controller, i);
- /* check for a device disconnect */
- if (((temp & (RH_PS_PESC | RH_PS_CSC)) ==
- (RH_PS_PESC | RH_PS_CSC)) &&
- ((temp & RH_PS_CCS) == 0)) {
- res = i;
- break;
- }
- }
- return res;
-}
-
static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
void *buffer, int transfer_len, struct devrequest *cmd)
{
@@ -1502,7 +1476,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
/* common code for handling submit messages - used for all but root hub */
/* accesses. */
-int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+static int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
int transfer_len, struct devrequest *setup, int interval,
int timeout)
{
@@ -1721,7 +1695,7 @@ static int hc_start(struct ohci *ohci)
static int hc_interrupt(struct ohci *ohci)
{
- struct ohci_regs *regs = ohci->regs;
+ struct ohci_regs __iomem *regs = ohci->regs;
int ints;
int stat = 0;
@@ -1840,7 +1814,7 @@ static int ohci_probe(struct device_d *dev)
usb_register_host(host);
- ohci->regs = (void *)dev->resource[0].start;
+ ohci->regs = dev_request_mem_region(dev, 0);
return 0;
}
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 913296319e..9c9b8375ce 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -408,7 +408,7 @@ struct ohci {
int disabled; /* e.g. got a UE, we're hung */
unsigned long flags; /* for HC bugs */
- struct ohci_regs *regs; /* OHCI controller's memory */
+ struct ohci_regs __iomem *regs; /* OHCI controller's memory */
int ohci_int_load[32]; /* load of the 32 Interrupt Chains (for load balancing)*/
struct ed *ed_rm_list[2]; /* lists of all endpoints to be removed */
diff --git a/fs/fat/ff.c b/fs/fat/ff.c
index 2d476ee2d5..66db1d6b50 100644
--- a/fs/fat/ff.c
+++ b/fs/fat/ff.c
@@ -1043,7 +1043,7 @@ int dir_register ( /* 0:Successful, FR_DENIED:No free entry or too many SFN coll
if (sn[NS] & NS_LOSS) {
/* When LFN is out of 8.3 format, generate a numbered name */
- fn[NS] = 0; dj->lfn = 0; /* Find only SFN */
+ fn[NS] = 0; dj->lfn = NULL; /* Find only SFN */
for (n = 1; n < 100; n++) {
gen_numname(fn, sn, lfn, n); /* Generate a numbered name */
res = dir_find(dj); /* Check if the name collides with existing SFN */
@@ -1496,7 +1496,7 @@ int follow_path ( /* 0(0): successful, !=0: error code */
if ((UINT)*path < ' ') {
/* Nul path means the start directory itself */
res = dir_sdi(dj, 0);
- dj->dir = 0;
+ dj->dir = NULL;
return res;
}
@@ -1718,7 +1718,7 @@ int f_open (
DEF_NAMEBUF;
- fp->fs = 0; /* Clear file object */
+ fp->fs = NULL; /* Clear file object */
#ifdef CONFIG_FS_FAT_WRITE
mode &= FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW;
@@ -2059,7 +2059,7 @@ int f_close (
/* Flush cached data */
res = f_sync(fp);
if (res == 0)
- fp->fs = 0; /* Discard file object */
+ fp->fs = NULL; /* Discard file object */
return res;
#endif
}
@@ -2308,7 +2308,7 @@ int f_getfree (
} else {
clst = fatfs->n_fatent;
sect = fatfs->fatbase;
- i = 0; p = 0;
+ i = 0; p = NULL;
do {
if (!i) {
res = move_window(fatfs, sect++);
diff --git a/include/driver.h b/include/driver.h
index eacd8e6813..a5e3f44212 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -183,7 +183,7 @@ static inline const char *dev_name(const struct device_d *dev)
/*
* get register base 'num' for a device
*/
-void __iomem *dev_get_mem_region(struct device_d *dev, int num);
+void *dev_get_mem_region(struct device_d *dev, int num);
/*
* exlusively request register base 'num' for a device
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 5be3dab4a6..cc8c4de43e 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -4,7 +4,7 @@
#ifndef __ASSEMBLY__
#ifdef __CHECKER__
-# define __user __attribute__((noderef, address_space(1)))
+# define __user /* no user address space in barebox */
# define __kernel /* default address space */
# define __safe __attribute__((safe))
# define __force __attribute__((force))
diff --git a/include/qsort.h b/include/qsort.h
index bbb23595b2..d279dc2810 100644
--- a/include/qsort.h
+++ b/include/qsort.h
@@ -4,4 +4,6 @@
void qsort(void *base, size_t nel, size_t width,
int (*comp)(const void *, const void *));
+int strcmp_compar(const void *p1, const void *p2);
+
#endif /* __QSORT_H */