This fixes a number of sparse warnings like:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] <asn:2>*addr
got unsigned int *<noident>
warning: Using plain integer as NULL pointer
Additionally this fixes a warning from checkpatch.pl like:
WARNING: sizeof pch_param.station should be sizeof(pch_param.station)
Signed-off-by: Sahara <keun-o.park@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
* struct pch_dev - Driver private data
*/
struct pch_dev {
* struct pch_dev - Driver private data
*/
struct pch_dev {
- struct pch_ts_regs *regs;
+ struct pch_ts_regs __iomem *regs;
struct ptp_clock *ptp_clock;
struct ptp_clock_info caps;
int exts0_enabled;
struct ptp_clock *ptp_clock;
struct ptp_clock_info caps;
int exts0_enabled;
iowrite32(val, (&chip->regs->ts_sel));
}
iowrite32(val, (&chip->regs->ts_sel));
}
-static u64 pch_systime_read(struct pch_ts_regs *regs)
+static u64 pch_systime_read(struct pch_ts_regs __iomem *regs)
-static void pch_systime_write(struct pch_ts_regs *regs, u64 ns)
+static void pch_systime_write(struct pch_ts_regs __iomem *regs, u64 ns)
struct pch_dev *chip = pci_get_drvdata(pdev);
/* Verify the parameter */
struct pch_dev *chip = pci_get_drvdata(pdev);
/* Verify the parameter */
- if ((chip->regs == 0) || addr == (u8 *)NULL) {
+ if ((chip->regs == NULL) || addr == (u8 *)NULL) {
dev_err(&pdev->dev,
"invalid params returning PCH_INVALIDPARAM\n");
return PCH_INVALIDPARAM;
dev_err(&pdev->dev,
"invalid params returning PCH_INVALIDPARAM\n");
return PCH_INVALIDPARAM;
static irqreturn_t isr(int irq, void *priv)
{
struct pch_dev *pch_dev = priv;
static irqreturn_t isr(int irq, void *priv)
{
struct pch_dev *pch_dev = priv;
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
struct ptp_clock_event event;
u32 ack = 0, lo, hi, val;
struct ptp_clock_event event;
u32 ack = 0, lo, hi, val;
u32 diff, addend;
int neg_adj = 0;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
u32 diff, addend;
int neg_adj = 0;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
if (ppb < 0) {
neg_adj = 1;
if (ppb < 0) {
neg_adj = 1;
s64 now;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
s64 now;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
spin_lock_irqsave(&pch_dev->register_lock, flags);
now = pch_systime_read(regs);
spin_lock_irqsave(&pch_dev->register_lock, flags);
now = pch_systime_read(regs);
u32 remainder;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
u32 remainder;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
spin_lock_irqsave(&pch_dev->register_lock, flags);
ns = pch_systime_read(regs);
spin_lock_irqsave(&pch_dev->register_lock, flags);
ns = pch_systime_read(regs);
u64 ns;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
u64 ns;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
ns = ts->tv_sec * 1000000000ULL;
ns += ts->tv_nsec;
ns = ts->tv_sec * 1000000000ULL;
ns += ts->tv_nsec;
free_irq(pdev->irq, chip);
/* unmap the virtual IO memory space */
free_irq(pdev->irq, chip);
/* unmap the virtual IO memory space */
+ if (chip->regs != NULL) {
}
/* release the reserved IO memory space */
if (chip->mem_base != 0) {
}
/* release the reserved IO memory space */
if (chip->mem_base != 0) {
err_req_irq:
ptp_clock_unregister(chip->ptp_clock);
iounmap(chip->regs);
err_req_irq:
ptp_clock_unregister(chip->ptp_clock);
iounmap(chip->regs);
err_ioremap:
release_mem_region(chip->mem_base, chip->mem_size);
err_ioremap:
release_mem_region(chip->mem_base, chip->mem_size);
module_init(ptp_pch_init);
module_exit(ptp_pch_exit);
module_init(ptp_pch_init);
module_exit(ptp_pch_exit);
-module_param_string(station, pch_param.station, sizeof pch_param.station, 0444);
+module_param_string(station,
+ pch_param.station, sizeof(pch_param.station), 0444);
MODULE_PARM_DESC(station,
"IEEE 1588 station address to use - colon separated hex values");
MODULE_PARM_DESC(station,
"IEEE 1588 station address to use - colon separated hex values");