aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mti-sead3
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:10:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:10:34 -0400
commit82abb273d838318424644d8f02825db0fbbd400a (patch)
treee1ea8a92db4ba68f347249986ffe3a25ffbf8219 /arch/mips/mti-sead3
parent9b651cc2277b5e4883012ebab0fea2bcda4cbafa (diff)
parentf8647b506d7116a1a3accd8d618184096e85f50b (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: - three fixes for 3.15 that didn't make it in time - limited Octeon 3 support. - paravirtualization support - improvment to platform support for Netlogix SOCs. - add support for powering down the Malta eval board in software - add many instructions to the in-kernel microassembler. - add support for the BPF JIT. - minor cleanups of the BCM47xx code. - large cleanup of math emu code resulting in significant code size reduction, better readability of the code and more accurate emulation. - improvments to the MIPS CPS code. - support C3 power status for the R4k count/compare clock device. - improvments to the GIO support for older SGI workstations. - increase number of supported CPUs to 256; this can be reached on certain embedded multithreaded ccNUMA configurations. - various small cleanups, updates and fixes * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (173 commits) MIPS: IP22/IP28: Improve GIO support MIPS: Octeon: Add twsi interrupt initialization for OCTEON 3XXX, 5XXX, 63XX DEC: Document the R4k MB ASIC mini interrupt controller DEC: Add self as the maintainer MIPS: Add microMIPS MSA support. MIPS: Replace calls to obsolete strict_strto call with kstrto* equivalents. MIPS: Replace obsolete strict_strto call with kstrto MIPS: BFP: Simplify code slightly. MIPS: Call find_vma with the mmap_sem held MIPS: Fix 'write_msa_##' inline macro. MIPS: Fix MSA toolchain support detection. mips: Update the email address of Geert Uytterhoeven MIPS: Add minimal defconfig for mips_paravirt MIPS: Enable build for new system 'paravirt' MIPS: paravirt: Add pci controller for virtio MIPS: Add code for new system 'paravirt' MIPS: Add functions for hypervisor call MIPS: OCTEON: Add OCTEON3 to __get_cpu_type MIPS: Add function get_ebase_cpunum MIPS: Add minimal support for OCTEON3 to c-r4k.c ...
Diffstat (limited to 'arch/mips/mti-sead3')
-rw-r--r--arch/mips/mti-sead3/sead3-pic32-i2c-drv.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c
index b921e5ec507c..80fe194cfa53 100644
--- a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c
+++ b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c
@@ -312,16 +312,13 @@ static int i2c_platform_probe(struct platform_device *pdev)
312 312
313 pr_debug("i2c_platform_probe\n"); 313 pr_debug("i2c_platform_probe\n");
314 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 314 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
315 if (!r) { 315 if (!r)
316 ret = -ENODEV; 316 return -ENODEV;
317 goto out;
318 }
319 317
320 priv = kzalloc(sizeof(struct i2c_platform_data), GFP_KERNEL); 318 priv = devm_kzalloc(&pdev->dev, sizeof(struct i2c_platform_data),
321 if (!priv) { 319 GFP_KERNEL);
322 ret = -ENOMEM; 320 if (!priv)
323 goto out; 321 return -ENOMEM;
324 }
325 322
326 /* FIXME: need to allocate resource in PIC32 space */ 323 /* FIXME: need to allocate resource in PIC32 space */
327#if 0 324#if 0
@@ -330,10 +327,8 @@ static int i2c_platform_probe(struct platform_device *pdev)
330#else 327#else
331 priv->base = r->start; 328 priv->base = r->start;
332#endif 329#endif
333 if (!priv->base) { 330 if (!priv->base)
334 ret = -EBUSY; 331 return -EBUSY;
335 goto out_mem;
336 }
337 332
338 priv->xfer_timeout = 200; 333 priv->xfer_timeout = 200;
339 priv->ack_timeout = 200; 334 priv->ack_timeout = 200;
@@ -348,17 +343,13 @@ static int i2c_platform_probe(struct platform_device *pdev)
348 i2c_platform_setup(priv); 343 i2c_platform_setup(priv);
349 344
350 ret = i2c_add_numbered_adapter(&priv->adap); 345 ret = i2c_add_numbered_adapter(&priv->adap);
351 if (ret == 0) { 346 if (ret) {
352 platform_set_drvdata(pdev, priv); 347 i2c_platform_disable(priv);
353 return 0; 348 return ret;
354 } 349 }
355 350
356 i2c_platform_disable(priv); 351 platform_set_drvdata(pdev, priv);
357 352 return 0;
358out_mem:
359 kfree(priv);
360out:
361 return ret;
362} 353}
363 354
364static int i2c_platform_remove(struct platform_device *pdev) 355static int i2c_platform_remove(struct platform_device *pdev)
@@ -369,7 +360,6 @@ static int i2c_platform_remove(struct platform_device *pdev)
369 platform_set_drvdata(pdev, NULL); 360 platform_set_drvdata(pdev, NULL);
370 i2c_del_adapter(&priv->adap); 361 i2c_del_adapter(&priv->adap);
371 i2c_platform_disable(priv); 362 i2c_platform_disable(priv);
372 kfree(priv);
373 return 0; 363 return 0;
374} 364}
375 365