[PATCH] media: staging/imx: Allow driver to build if COMPILE_TEST is enabled

2019-02-19 Thread Javier Martinez Canillas
The driver has runtime but no build time dependency with IMX_IPUV3_CORE,
so can be built for testing purposes if COMPILE_TEST option is enabled.

This is useful to have more build coverage and make sure that the driver
is not affected by changes that could cause build regressions.

Signed-off-by: Javier Martinez Canillas 

---

 drivers/staging/media/imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/Kconfig 
b/drivers/staging/media/imx/Kconfig
index 36b276ea2ec..5045e24c470 100644
--- a/drivers/staging/media/imx/Kconfig
+++ b/drivers/staging/media/imx/Kconfig
@@ -1,7 +1,7 @@
 config VIDEO_IMX_MEDIA
tristate "i.MX5/6 V4L2 media core driver"
depends on ARCH_MXC || COMPILE_TEST
-   depends on MEDIA_CONTROLLER && VIDEO_V4L2 && IMX_IPUV3_CORE
+   depends on MEDIA_CONTROLLER && VIDEO_V4L2 && (IMX_IPUV3_CORE || 
COMPILE_TEST)
depends on VIDEO_V4L2_SUBDEV_API
depends on HAS_DMA
select VIDEOBUF2_DMA_CONTIG
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: comedi: ssv_dnp: Remove unnecessary comment

2018-06-14 Thread Javier Martinez
Removal of a comment that was not needed at all.
We can clearly see that they are include/header files.

Signed-off-by: Javier Martinez 
---
 drivers/staging/comedi/drivers/ssv_dnp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ssv_dnp.c 
b/drivers/staging/comedi/drivers/ssv_dnp.c
index 0628060e42ca..50de018ab9bb 100644
--- a/drivers/staging/comedi/drivers/ssv_dnp.c
+++ b/drivers/staging/comedi/drivers/ssv_dnp.c
@@ -16,7 +16,6 @@
  * Status: unknown
  */
 
-/* include files --- */
 
 #include 
 #include "../comedidev.h"
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: octeon-usb: octeon-hcd.c: Remove boiler plate and add SPDX

2018-06-13 Thread Javier Martinez
Removed massive boiler plate text at top of the file and instead
replaced it with a simple SPDX license identifier.

Signed-off-by: Javier Martinez 
---
 drivers/staging/octeon-usb/octeon-hcd.c | 47 ++---
 1 file changed, 2 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
b/drivers/staging/octeon-usb/octeon-hcd.c
index cded30f145aa..df61e8321140 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -1,48 +1,5 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2008 Cavium Networks
- *
- * Some parts of the code were originally released under BSD license:
- *
- * Copyright (c) 2003-2010 Cavium Networks (supp...@cavium.com). All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *   * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- *   * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- *   * Neither the name of Cavium Networks nor the names of
- * its contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * This Software, including technical data, may be subject to U.S. export
- * control laws, including the U.S. Export Administration Act and its 
associated
- * regulations, and may be subject to export or import regulations in other
- * countries.
- *
- * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
- * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS 
OR
- * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT 
TO
- * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION
- * OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
- * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
- * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
- * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
- * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
- * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
- */
+// SPDX-License-Identifier: GNU GPL
+
 
 #include 
 #include 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: octeon-usb: octeon-hcd.c: style fix line length warning

2018-06-13 Thread Javier Martinez
Checkpatch.pl issued a warning in the top of the commment within
octeon-hcd.c. This is a simple style fix for that.

Signed-off-by: Javier Martinez 
---
 drivers/staging/octeon-usb/octeon-hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
b/drivers/staging/octeon-usb/octeon-hcd.c
index cded30f145aa..768b0148f3d5 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -1,5 +1,5 @@
 /*
- * This file is subject to the terms and conditions of the GNU General Public
+ * This file is subject to the terms and conditions of the GPL
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: comedi: ssv_dnp: fixed style line length warning

2018-06-13 Thread Javier Martinez
Fixed style line length warning detected by checkpatch.pl in the file
ssv_dnp.c.

Signed-off-by: Javier Martinez 
---
 drivers/staging/comedi/drivers/ssv_dnp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ssv_dnp.c 
b/drivers/staging/comedi/drivers/ssv_dnp.c
index 0628060e42ca..87f46e0eb9ee 100644
--- a/drivers/staging/comedi/drivers/ssv_dnp.c
+++ b/drivers/staging/comedi/drivers/ssv_dnp.c
@@ -16,7 +16,7 @@
  * Status: unknown
  */
 
-/* include files --- */
+/* include files -- */
 
 #include 
 #include "../comedidev.h"
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: comedi: ssv_dnp: fixed style line length warning

2018-06-13 Thread Javier Martinez
Fixed style line length warning detected by checkpatch.pl in the file
ssv_dnp.c.

Signed-off-by: Javier Martinez 
---
 drivers/staging/comedi/drivers/ssv_dnp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ssv_dnp.c 
b/drivers/staging/comedi/drivers/ssv_dnp.c
index 0628060e42ca..87f46e0eb9ee 100644
--- a/drivers/staging/comedi/drivers/ssv_dnp.c
+++ b/drivers/staging/comedi/drivers/ssv_dnp.c
@@ -16,7 +16,7 @@
  * Status: unknown
  */
 
-/* include files --- */
+/* include files -- */
 
 #include 
 #include "../comedidev.h"
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: typec: fusb302: Fix module autoload

2017-05-04 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the OF and I2C device ID table entries as module aliases, using the
MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/typec/fusb302/fusb302.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/typec/fusb302/fusb302.ko | grep alias
alias:  of:N*T*Cfcs,fusb302C*
alias:  of:N*T*Cfcs,fusb302
alias:  i2c:typec_fusb302

Signed-off-by: Javier Martinez Canillas <jav...@dowhile0.org>
---

 drivers/staging/typec/fusb302/fusb302.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/typec/fusb302/fusb302.c 
b/drivers/staging/typec/fusb302/fusb302.c
index 2cee9a952c9b..aa460f93a293 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -1787,11 +1787,13 @@ static const struct of_device_id fusb302_dt_match[] = {
{.compatible = "fcs,fusb302"},
{},
 };
+MODULE_DEVICE_TABLE(of, fusb302_dt_match);
 
 static const struct i2c_device_id fusb302_i2c_device_id[] = {
{"typec_fusb302", 0},
{},
 };
+MODULE_DEVICE_TABLE(i2c, fusb302_i2c_device_id);
 
 static const struct dev_pm_ops fusb302_pm_ops = {
.suspend = fusb302_pm_suspend,
-- 
2.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC] [media] imx: assume MEDIA_ENT_F_ATV_DECODER entities output video on pad 1

2017-04-05 Thread Javier Martinez Canillas
Hello Philipp,

On Wed, Apr 5, 2017 at 5:34 AM, Philipp Zabel  wrote:
> On Wed, 2017-04-05 at 09:21 +0100, Russell King - ARM Linux wrote:

[snip]

> I think the output part is accurate, as the audio pad is an artifact of
> an unrelated change. I'm not so sure about the VBI pad, but I think that
> shouldn't exist either. The input pad, on the other hand, not having any
> of graph representation in the device tree seems a bit strange. There

Agreed, there should be a OF graph representation (and also a MC
representation) of the input PADs.

The tvp5150 driver currently has hardcoded as input TVP5150_COMPOSITE1
(AIP1B), so it won't work for a board that has the composite connector
wired to TVP5150_COMPOSITE0 (AIP1A) neither will work for S-Video
(AIP1A + AIP1B).

> was a custom binding for the inputs, that got quickly reverted:
> https://patchwork.kernel.org/patch/8395521/
>

Yes, that was my first attempt to have input connector support for
tvp5150. The patches were merged without a detailed review of the DT
bindings and latter were found to be wrong. Instead of having a driver
specific DT binding, a generic binding that could be used by any
device should be defined.

The latest proposal was [0] but that was also found to be inadequate.
After a lot of discussion on #v4l, the best approach we could come
with was something like like [1]. But I was busy with other stuff and
never found time to do the driver changes.

By the way, only the DT bindings portion from the first approach got
reverted but the patch reverting the driver changes never made to
mainline. Could you please test if [2] doesn't cause any issues to you
so the left over can be finally removed?

> regards
> Philipp
>

[0]: https://lkml.org/lkml/2016/4/12/983
[1]: https://hastebin.com/kadagidino.diff
[2]: https://patchwork.kernel.org/patch/9472623/

Best regards,
Javier
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 13/24] platform: add video-multiplexer subdevice driver

2017-01-24 Thread Javier Martinez Canillas
Hello Steve,

On Fri, Jan 6, 2017 at 11:11 PM, Steve Longerbeam  wrote:
> From: Philipp Zabel 

[snip]

>
> +config VIDEO_MULTIPLEXER
> +   tristate "Video Multiplexer"
> +   depends on VIDEO_V4L2_SUBDEV_API && MEDIA_CONTROLLER

The driver can be build as a module...

> +
> +static const struct of_device_id vidsw_dt_ids[] = {
> +   { .compatible = "video-multiplexer", },
> +   { /* sentinel */ }
> +};
> +

... so you need a MODULE_DEVICE_TABLE(of, vidsw_dt_ids) here or
otherwise module autoloading won't work.

Best regards,
Javier
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: fbtft: Fix module autoload

2016-10-17 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/fbtft/flexfb.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/fbtft/flexfb.ko | grep alias
alias:  platform:flexpfb

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
---

 drivers/staging/fbtft/flexfb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
index 2dc5f9b6b47e..ded10718712b 100644
--- a/drivers/staging/fbtft/flexfb.c
+++ b/drivers/staging/fbtft/flexfb.c
@@ -830,6 +830,7 @@ static const struct platform_device_id 
flexfb_platform_ids[] = {
{ "flexpfb", 0 },
{ },
 };
+MODULE_DEVICE_TABLE(platform, flexfb_platform_ids);
 
 static struct platform_driver flexfb_platform_driver = {
.driver = {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] [media] st-cec: Fix module autoload

2016-10-17 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
alias:  of:N*T*Cst,stih-cecC*
alias:  of:N*T*Cst,stih-cec

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>

---

 drivers/staging/media/st-cec/stih-cec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/st-cec/stih-cec.c 
b/drivers/staging/media/st-cec/stih-cec.c
index 214344866a6b..19d3ff30c8f8 100644
--- a/drivers/staging/media/st-cec/stih-cec.c
+++ b/drivers/staging/media/st-cec/stih-cec.c
@@ -363,6 +363,7 @@ static const struct of_device_id stih_cec_match[] = {
},
{},
 };
+MODULE_DEVICE_TABLE(of, stih_cec_match);
 
 static struct platform_driver stih_cec_pdrv = {
.probe  = stih_cec_probe,
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] [media] s5p-cec: Fix module autoload

2016-10-17 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
alias:  of:N*T*Csamsung,s5p-cecC*
alias:  of:N*T*Csamsung,s5p-cec

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
---

 drivers/staging/media/s5p-cec/s5p_cec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c 
b/drivers/staging/media/s5p-cec/s5p_cec.c
index 1780a08b73c9..4e41f72dbfaa 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/staging/media/s5p-cec/s5p_cec.c
@@ -263,6 +263,7 @@ static const struct of_device_id s5p_cec_match[] = {
},
{},
 };
+MODULE_DEVICE_TABLE(of, s5p_cec_match);
 
 static struct platform_driver s5p_cec_pdrv = {
.probe  = s5p_cec_probe,
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] [media] Fix module autoload for media platform drivers

2016-10-17 Thread Javier Martinez Canillas
Hello Mauro,

I noticed that module autoload won't be working in a bunch of media
platform drivers because the module alias information is not filled
in the modules. This patch series contains the fixes for them.

Best regards,
Javier


Javier Martinez Canillas (5):
  [media] v4l: vsp1: Fix module autoload for OF registration
  [media] v4l: rcar-fcp: Fix module autoload for OF registration
  [media] rc: meson-ir: Fix module autoload
  [media] s5p-cec: Fix module autoload
  [media] st-cec: Fix module autoload

 drivers/media/platform/rcar-fcp.c   | 1 +
 drivers/media/platform/vsp1/vsp1_drv.c  | 1 +
 drivers/media/rc/meson-ir.c | 1 +
 drivers/staging/media/s5p-cec/s5p_cec.c | 1 +
 drivers/staging/media/st-cec/stih-cec.c | 1 +
 5 files changed, 5 insertions(+)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RESEND PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-09-01 Thread Javier Martinez Canillas
On 09/01/2016 05:32 PM, Greg Kroah-Hartman wrote:
> On Thu, Aug 25, 2016 at 06:56:07PM -0400, Javier Martinez Canillas wrote:
>> Hello David,
>>
>> On 08/25/2016 12:01 PM, David Daney wrote:
>>> On 08/25/2016 06:55 AM, Javier Martinez Canillas wrote:
>>>> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
>>>> built-in or as a module, use that macro instead of open coding the same.
>>>>
>>>> Using the macro makes the code more readable by helping abstract away some
>>>> of the Kconfig built-in and module enable details.
>>>>
>>>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>>>> Acked-by: David Daney <david.da...@cavium.com>
>>>>
>>>> ---
>>>>
>>>> Changes since first post:
>>>> - Added David Daney Acked-by tag.
>>>> - Rebased on top of latest master.
>>>>
>>>
>>> You changed something about the patch.  In this case the Subject is not 
>>> "RESEND", but rather "v2".  Incorrect Subject lines like this can lead to 
>>> the patch being inadvertently ignored.
>>>
>>
>> Yes, in fact I thought about adding a v2 suffix instead of RESEND but since
>> I didn't change the patch content (besides merge conflicts resolution), I
>> preferred to add the latter.
>>
>> I can re-spin the patch if that's an issue.
> 
> Please do.
>

Done.
 
> thanks,
> 
> greg k-h
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-09-01 Thread Javier Martinez Canillas
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
Acked-by: David Daney <david.da...@cavium.com>

---

Changes in v2:
- Added David Daney Acked-by tag.
- Rebased on top of latest master.

 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet.c 
b/drivers/staging/octeon/ethernet.c
index 2eb97317f631..a473f034b01a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -237,7 +237,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
*dev, int new_mtu)
 {
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
int vlan_bytes = 4;
 #else
int vlan_bytes = 0;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RESEND PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread Javier Martinez Canillas
Hello David,

On 08/25/2016 12:01 PM, David Daney wrote:
> On 08/25/2016 06:55 AM, Javier Martinez Canillas wrote:
>> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
>> built-in or as a module, use that macro instead of open coding the same.
>>
>> Using the macro makes the code more readable by helping abstract away some
>> of the Kconfig built-in and module enable details.
>>
>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>> Acked-by: David Daney <david.da...@cavium.com>
>>
>> ---
>>
>> Changes since first post:
>> - Added David Daney Acked-by tag.
>> - Rebased on top of latest master.
>>
> 
> You changed something about the patch.  In this case the Subject is not 
> "RESEND", but rather "v2".  Incorrect Subject lines like this can lead to the 
> patch being inadvertently ignored.
>

Yes, in fact I thought about adding a v2 suffix instead of RESEND but since
I didn't change the patch content (besides merge conflicts resolution), I
preferred to add the latter.

I can re-spin the patch if that's an issue.

> David Daney
> 
 
Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RESEND PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread Javier Martinez Canillas
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
Acked-by: David Daney <david.da...@cavium.com>

---

Changes since first post:
- Added David Daney Acked-by tag.
- Rebased on top of latest master.

 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet.c 
b/drivers/staging/octeon/ethernet.c
index 2eb97317f631..a473f034b01a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -237,7 +237,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
*dev, int new_mtu)
 {
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
int vlan_bytes = 4;
 #else
int vlan_bytes = 0;
-- 
2.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread Javier Martinez Canillas
Hello Greg,

On 08/21/2016 12:02 PM, Greg Kroah-Hartman wrote:
> On Thu, Jul 14, 2016 at 01:06:09PM -0400, Javier Martinez Canillas wrote:
>> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
>> built-in or as a module, use that macro instead of open coding the same.
>>
>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>> Acked-by: David Daney <david.da...@cavium.com>
>> ---
>>
>>  drivers/staging/octeon/ethernet.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/octeon/ethernet.c 
>> b/drivers/staging/octeon/ethernet.c
>> index e9cd5f242921..c0c62143ffc8 100644
>> --- a/drivers/staging/octeon/ethernet.c
>> +++ b/drivers/staging/octeon/ethernet.c
>> @@ -238,7 +238,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
>> *dev, int new_mtu)
>>  struct octeon_ethernet *priv = netdev_priv(dev);
>>  int interface = INTERFACE(priv->port);
>>  int index = INDEX(priv->port);
>> -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
>> +#if IS_ENABLED(CONFIG_VLAN_8021Q)
>>  int vlan_bytes = 4;
>>  #else
>>  int vlan_bytes = 0;
> 
> Fails to apply to the tree :(
> 

Ok, it used to apply when the patch was posted so I guess that something
changed in the code. I'll post a new one rebased on top of latest head.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-07-14 Thread Javier Martinez Canillas
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
---

 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet.c 
b/drivers/staging/octeon/ethernet.c
index e9cd5f242921..c0c62143ffc8 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -238,7 +238,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
*dev, int new_mtu)
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
int index = INDEX(priv->port);
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
int vlan_bytes = 4;
 #else
int vlan_bytes = 0;
-- 
2.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] [media] media: rename media unregister function

2016-03-19 Thread Javier Martinez Canillas
Hello Mauro,

On 03/18/2016 10:05 AM, Mauro Carvalho Chehab wrote:
> Now that media_device_unregister() also does a cleanup, rename it
> to media_device_unregister_cleanup().
>

I believe there should be a Suggested-by Sakari Ailus tag here.
 
> Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>

The patch looks good and I agree that makes things more clear.

Reviewed-by: Javier Martinez Canillas <jav...@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] [media] media: rename media unregister function

2016-03-18 Thread Javier Martinez Canillas
Hello Shuah,

On 03/18/2016 11:01 AM, Shuah Khan wrote:
> On 03/18/2016 07:05 AM, Mauro Carvalho Chehab wrote:
>> Now that media_device_unregister() also does a cleanup, rename it
>> to media_device_unregister_cleanup().
>>
>> Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
> 
> I think adding cleanup is redundant. media_device_unregister()
> would imply that there has to be some cleanup releasing resources.
> I wouldn't make this change.
>

Problem is that there is a media_device_init() and media_device_register(),
so having both unregister and cleanup in this function will make very clear
that a single function is the counter part of the previous two operations.
 
> thanks,
> -- Shuah
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 02/55] [media] staging: omap4iss: get entity ID using media_entity_id()

2015-12-07 Thread Javier Martinez Canillas
Hello Laurent,

On 12/06/2015 12:18 AM, Laurent Pinchart wrote:
> Hi Javier,
> 
> Thank you for the patch.
> 
> On Sunday 30 August 2015 00:06:13 Mauro Carvalho Chehab wrote:
>> From: Javier Martinez Canillas <jav...@osg.samsung.com>
>>
>> Assessing media_entity ID should now use media_entity_id() macro to
> 
> Did you mean "accessing" ?
>

Sigh, yet another typo error that seems to be due copy and paste.
 
>> obtain the entity ID, as a next patch will remove the .id field from
>> struct media_entity .
>>
>> So, get rid of it, otherwise the omap4iss driver will fail to build.
>>
>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>> Acked-by: Hans Verkuil <hans.verk...@cisco.com>
>> Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
> 
> With the typo fixed,
> 
> Acked-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
>

Thanks.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/5] [media] staging: omap4iss: separate links creation from entities init

2015-12-07 Thread Javier Martinez Canillas
Hello Laurent,

On 12/06/2015 12:10 AM, Laurent Pinchart wrote:
> Hi Javier,
> 
> Thank you for the patch.
>

Thanks for your feedback.
 
> On Thursday 03 September 2015 18:00:32 Javier Martinez Canillas wrote:
>> The omap4iss driver initializes the entities and creates the pads links
>> before the entities are registered with the media device. This does not
>> work now that object IDs are used to create links so the media_device
>> has to be set.
>>
>> Split out the pads links creation from the entity initialization so are
>> made after the entities registration.
>>
>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>> ---
>>
>>  drivers/staging/media/omap4iss/iss.c | 101 +++-
>>  drivers/staging/media/omap4iss/iss_csi2.c|  35 +++---
>>  drivers/staging/media/omap4iss/iss_csi2.h|   1 +
>>  drivers/staging/media/omap4iss/iss_ipipeif.c |  29 
>>  drivers/staging/media/omap4iss/iss_ipipeif.h |   1 +
>>  drivers/staging/media/omap4iss/iss_resizer.c |  29 
>>  drivers/staging/media/omap4iss/iss_resizer.h |   1 +
>>  7 files changed, 132 insertions(+), 65 deletions(-)
>>
>> diff --git a/drivers/staging/media/omap4iss/iss.c
>> b/drivers/staging/media/omap4iss/iss.c index 44b88ff3ba83..076ddd412201
>> 100644
>> --- a/drivers/staging/media/omap4iss/iss.c
>> +++ b/drivers/staging/media/omap4iss/iss.c
>> @@ -1272,6 +1272,68 @@ done:
>>  return ret;
>>  }
>>
>> +/*
>> + * iss_create_pads_links() - Pads links creation for the subdevices
> 
> Could you please s/pads_links/links/ and s/pads links/links/ ?
>

Yes, as mentioned in the other thread, I'll do that for all the
drivers that only create pad links.
 
> Apart from that,
> 
> Acked-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
>

Thanks!

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgap: fix returned errno code in dgap_parsefile()

2015-09-22 Thread Javier Martinez Canillas
Hello Sudip,

On 09/22/2015 06:52 AM, Sudip Mukherjee wrote:
> On Tue, Sep 22, 2015 at 02:39:36AM +0200, Javier Martinez Canillas wrote:
>> The driver is using -1 instead of the -ENOMEM defined macro to specify
>> that a buffer allocation failed. Since the error number is propagated,
>> the caller will get a -EPERM which is the wrong error condition.
> Just a little doubt. caller means the function which is calling this
> dgap_parsefile() or you meant the user?

I meant whatever function calls dgap_parsefile(), which currently is
only dgap_firmware_load().

> The function which is calling this dgap_parsefile() is just checking if
> it has received 0 or something else. Something else is error and it
> rerturns -EINVAL for all types of error (ofcourse that is also wrong).
> So the user will see -EINVAL for all types of error in dgap_parsefile().
>

Yes, I also verified what dgap_firmware_load() does with the returned error
code to make sure that it was safe to do this change without affecting the
rest of the driver.

But I believe the patch and what the commit message says is true regardless
of the fact that the caller is just checking for != 0. dgap_firmware_load()
stills gets a wrong error condition whether it's checking it or not.
 
> regards
> sudip
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: wicl1000: fix dereference after free in wilc_wlan_cleanup()

2015-09-22 Thread Javier Martinez Canillas
The wilc_wlan_cleanup() function iterates over the list of transmission
buffers freeing all of them and then iterates over the receive buffers
list to free all of them as well.

But on the receive loop a pointer to struct txq_entry_t is dereferenced
instead of the pointer to a struct rxq_entry_t. This not only causes a
dereference to a pointer already freed but also leaks the memory in the
struct rxq_entry_t buffer.

Also, the buffer is allocated when MEMORY_STATIC is not defined no when
MEMORY_DYNAMIC is defined. So use #ifndef MEMORY_STATIC instead as it's
done in the rest of the driver to avoid leaking the buffer memory.

Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>

---

Changes in v2:
- Change also the #ifdef MEMORY_DYNAMIC to #ifndef MEMORY_STATIC since buffer
  is allocated when MEMORY_STATIC isn't defined. Suggested by Sudip Mukherjee.

 drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 4c25179c2fec..fc9028d59dcd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1745,8 +1745,8 @@ static void wilc_wlan_cleanup(void)
rqe = wilc_wlan_rxq_remove();
if (rqe == NULL)
break;
-#ifdef MEMORY_DYNAMIC
-   kfree(tqe->buffer);
+#ifndef MEMORY_STATIC
+   kfree(rqe->buffer);
 #endif
kfree(rqe);
} while (1);
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wicl1000: fix dereference after free in wilc_wlan_cleanup()

2015-09-22 Thread Javier Martinez Canillas
Hello Sudip,

Thanks a lot for your feedback.

On 09/22/2015 02:16 PM, Sudip Mukherjee wrote:
> On Tue, Sep 22, 2015 at 12:24:50PM +0200, Javier Martinez Canillas wrote:
>> The wilc_wlan_cleanup() function iterates over the list of transmission
>> buffers freeing all of them and then iterates over the receive buffers
>> list to free all of them as well.
>>
>> But on the receive loop a pointer to struct txq_entry_t is dereferenced
>> instead of the pointer to a struct rxq_entry_t. This not only causes a
>> dereference to a pointer already freed but also leaks the memory in the
>> struct rxq_entry_t buffer.
>>
>> Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>>
>> ---
>>
>>  drivers/staging/wilc1000/wilc_wlan.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
>> b/drivers/staging/wilc1000/wilc_wlan.c
>> index 4c25179c2fec..c40f143b00b7 100644
>> --- a/drivers/staging/wilc1000/wilc_wlan.c
>> +++ b/drivers/staging/wilc1000/wilc_wlan.c
>> @@ -1746,7 +1746,7 @@ static void wilc_wlan_cleanup(void)
>>  if (rqe == NULL)
>>  break;
>>  #ifdef MEMORY_DYNAMIC
>> -kfree(tqe->buffer);
>> +kfree(rqe->buffer);
>>  #endif
> MEMORY_DYNAMIC is only used here and no where else. And buffer was
> allocated in the else part of #ifdef MEMORY_STATIC.
> So you should really be using #ifndef MEMORY_STATIC here instead of
> #ifdef MEMORY_DYNAMIC otherwise memory leak will still remain.
>

You are right that #ifndef MEMORY_STATIC should be used instead to fix
the memory leak. I'll post a v2 changing that as well.

> regards
> sudip
>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wicl1000: remove duplicated operand in OR operation

2015-09-22 Thread Javier Martinez Canillas
The IEEE80211_STYPE_PROBE_REQ flag appears twice in the expression
and coccicheck complains with:

wilc_wfi_cfgoperations.h:80:3-38: duplicated argument to & or |

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>

---

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 4d37c4e859e9..25490c2af1e9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -80,7 +80,6 @@ static const struct ieee80211_txrx_stypes
BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
-   BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
BIT(IEEE80211_STYPE_DISASSOC >> 4) |
BIT(IEEE80211_STYPE_AUTH >> 4) |
BIT(IEEE80211_STYPE_DEAUTH >> 4)
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgap: fix returned errno code in dgap_parsefile()

2015-09-21 Thread Javier Martinez Canillas
The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed. Since the error number is propagated,
the caller will get a -EPERM which is the wrong error condition.

Also, the smatch tool complains with the following warning:

dgap_parsefile() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>

---

 drivers/staging/dgap/dgap.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 303d97023ccb..e17bde7bf416 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -642,7 +642,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
 
@@ -861,7 +861,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = TNODE;
@@ -883,7 +883,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = CUNODE;
@@ -914,7 +914,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = LNODE;
@@ -933,7 +933,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = CNODE;
@@ -975,7 +975,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = MNODE;
@@ -1054,7 +1054,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = PNODE;
@@ -1076,7 +1076,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = JNODE;
@@ -1098,7 +1098,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = ANODE;
@@ -1120,7 +1120,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = INTRNODE;
@@ -1141,7 +1141,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = TSNODE;
@@ -1163,7 +1163,7 @@ static int dgap_parsefile(char **in)
 
p->next = kzalloc(sizeof(struct cnode), GFP_KERNEL);
if (!p->next)
-   return -1;
+   return -ENOMEM;
 
p = p->next;
p->type = CSNODE;
@@ -1185,7 +1185,7 @@ stati

Re: [PATCH v8 10/55] [media] media: rename the function that create pad links

2015-09-10 Thread Javier Martinez Canillas
On Sun, Aug 30, 2015 at 5:06 AM, Mauro Carvalho Chehab
<mche...@osg.samsung.com> wrote:
> With the new API, a link can be either between two PADs or between an 
> interface
> and an entity. So, we need to use a better name for the function that create
> links between two pads.
>
> So, rename the such function to media_create_pad_link().
>
> No functional changes.
>
> This patch was created via this shell script:
> for i in $(find drivers/media -name '*.[ch]' -type f) $(find 
> drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' 
> -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a 
> && mv a $i; done
>
> Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
> Acked-by: Hans Verkuil <hans.verk...@cisco.com>
> Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
>

Reviewed-by: Javier Martinez Canillas <jav...@osg.samsung.com>
Tested-by: Javier Martinez Canillas <jav...@osg.samsung.com>

Best regards,
Javier
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/18] staging: iio: hmc5843: Export missing SPI module alias information

2015-09-05 Thread Javier Martinez Canillas
Hello Jonathan,

On 09/05/2015 06:31 PM, Jonathan Cameron wrote:
> On 01/09/15 00:09, Javier Martinez Canillas wrote:
>> Hello Jonathan,
>>
>> On 08/22/2015 07:59 PM, Jonathan Cameron wrote:
>>> On 20/08/15 08:07, Javier Martinez Canillas wrote:
>>>> The SPI core always reports the MODALIAS uevent as "spi:"
>>>> regardless of the mechanism that was used to register the device
>>>> (i.e: OF or board code) and the table that is used later to match
>>>> the driver with the device (i.e: SPI id table or OF match table).
>>>>
>>>> So drivers needs to export the SPI id table and this be built into
>>>> the module or udev won't have the necessary information to autoload
>>>> the needed driver module when the device is added.
>>>>
>>>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
>>> Applied to the togreg branch of iio.git.
>>>
>>> This is too late for the upcoming merge window so it will be queued up for
>>> the next one.
>>>
>>
>> IMHO this patch and "[PATCH 01/18] iio: Export SPI module alias
>> information in missing drivers" [0] are fixing broken module
>> autoloading which are bugs so are material for the 4.3 -rc cycle.
> 
> It's a corner case.  Could also be argued that this isn't
> a bug but rather a case of a feature (autoprobing) being added
> that wasn't supported before.  It's not obligatory to support
> autoloading (even if we would normally aim to do so).
> 
> I'm happy enough for a request to apply these to stable occurs
> after they hit Linus' tree (as a trivial backport) but I don't
> think they really deserve being sent on as fixes.
> 
> Of course, I might be missing something that means something is
> actually broken, as opposed to not present.
>

Well, as a user I would expect that if I have a driver built-in
and it works, building it as a module will also work so I think
module autoload it's a bugfix and not a new feature.

And the patch is trivial and won't cause any issues so I don't
see why it can't be -rc material.

But of course is up to you, git log shows me that these drivers
have been since v3.10 so it seems that nobody cared anyways.
 
> Jonathan
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] [media] staging: omap4iss: separate links creation from entities init

2015-09-03 Thread Javier Martinez Canillas
The omap4iss driver initializes the entities and creates the pads links
before the entities are registered with the media device. This does not
work now that object IDs are used to create links so the media_device
has to be set.

Split out the pads links creation from the entity initialization so are
made after the entities registration.

Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
---

 drivers/staging/media/omap4iss/iss.c | 101 ++-
 drivers/staging/media/omap4iss/iss_csi2.c|  35 +++---
 drivers/staging/media/omap4iss/iss_csi2.h|   1 +
 drivers/staging/media/omap4iss/iss_ipipeif.c |  29 
 drivers/staging/media/omap4iss/iss_ipipeif.h |   1 +
 drivers/staging/media/omap4iss/iss_resizer.c |  29 
 drivers/staging/media/omap4iss/iss_resizer.h |   1 +
 7 files changed, 132 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss.c 
b/drivers/staging/media/omap4iss/iss.c
index 44b88ff3ba83..076ddd412201 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -1272,6 +1272,68 @@ done:
return ret;
 }
 
+/*
+ * iss_create_pads_links() - Pads links creation for the subdevices
+ * @iss : Pointer to ISS device
+ *
+ * return negative error code or zero on success
+ */
+static int iss_create_pads_links(struct iss_device *iss)
+{
+   int ret;
+
+   ret = omap4iss_csi2_create_pads_links(iss);
+   if (ret < 0) {
+   dev_err(iss->dev, "CSI2 pads links creation failed\n");
+   return ret;
+   }
+
+   ret = omap4iss_ipipeif_create_pads_links(iss);
+   if (ret < 0) {
+   dev_err(iss->dev, "ISP IPIPEIF pads links creation failed\n");
+   return ret;
+   }
+
+   ret = omap4iss_resizer_create_pads_links(iss);
+   if (ret < 0) {
+   dev_err(iss->dev, "ISP RESIZER pads links creation failed\n");
+   return ret;
+   }
+
+   /* Connect the submodules. */
+   ret = media_create_pad_link(
+   >csi2a.subdev.entity, CSI2_PAD_SOURCE,
+   >ipipeif.subdev.entity, IPIPEIF_PAD_SINK, 0);
+   if (ret < 0)
+   return ret;
+
+   ret = media_create_pad_link(
+   >csi2b.subdev.entity, CSI2_PAD_SOURCE,
+   >ipipeif.subdev.entity, IPIPEIF_PAD_SINK, 0);
+   if (ret < 0)
+   return ret;
+
+   ret = media_create_pad_link(
+   >ipipeif.subdev.entity, IPIPEIF_PAD_SOURCE_VP,
+   >resizer.subdev.entity, RESIZER_PAD_SINK, 0);
+   if (ret < 0)
+   return ret;
+
+   ret = media_create_pad_link(
+   >ipipeif.subdev.entity, IPIPEIF_PAD_SOURCE_VP,
+   >ipipe.subdev.entity, IPIPE_PAD_SINK, 0);
+   if (ret < 0)
+   return ret;
+
+   ret = media_create_pad_link(
+   >ipipe.subdev.entity, IPIPE_PAD_SOURCE_VP,
+   >resizer.subdev.entity, RESIZER_PAD_SINK, 0);
+   if (ret < 0)
+   return ret;
+
+   return 0;
+};
+
 static void iss_cleanup_modules(struct iss_device *iss)
 {
omap4iss_csi2_cleanup(iss);
@@ -1314,41 +1376,8 @@ static int iss_initialize_modules(struct iss_device *iss)
goto error_resizer;
}
 
-   /* Connect the submodules. */
-   ret = media_create_pad_link(
-   >csi2a.subdev.entity, CSI2_PAD_SOURCE,
-   >ipipeif.subdev.entity, IPIPEIF_PAD_SINK, 0);
-   if (ret < 0)
-   goto error_link;
-
-   ret = media_create_pad_link(
-   >csi2b.subdev.entity, CSI2_PAD_SOURCE,
-   >ipipeif.subdev.entity, IPIPEIF_PAD_SINK, 0);
-   if (ret < 0)
-   goto error_link;
-
-   ret = media_create_pad_link(
-   >ipipeif.subdev.entity, IPIPEIF_PAD_SOURCE_VP,
-   >resizer.subdev.entity, RESIZER_PAD_SINK, 0);
-   if (ret < 0)
-   goto error_link;
-
-   ret = media_create_pad_link(
-   >ipipeif.subdev.entity, IPIPEIF_PAD_SOURCE_VP,
-   >ipipe.subdev.entity, IPIPE_PAD_SINK, 0);
-   if (ret < 0)
-   goto error_link;
-
-   ret = media_create_pad_link(
-   >ipipe.subdev.entity, IPIPE_PAD_SOURCE_VP,
-   >resizer.subdev.entity, RESIZER_PAD_SINK, 0);
-   if (ret < 0)
-   goto error_link;
-
return 0;
 
-error_link:
-   omap4iss_resizer_cleanup(iss);
 error_resizer:
omap4iss_ipipe_cleanup(iss);
 error_ipipe:
@@ -1461,10 +1490,16 @@ static int iss_probe(struct platform_device *pdev)
if (ret < 0)
goto error_modules;

[PATCH 0/5] [media] Create pads links after entities registration

2015-09-03 Thread Javier Martinez Canillas
Hello,

This series changes all the MC media drivers that are currently creating
pads links before registering the media entities with the media device.

The patches are similar to the ones posted for the OMAP3 ISP driver [0]
and depends on Mauro's "[PATCH v8 00/55] MC next generation patches" [1].

The patches just moves the entities registration logic before pads links
creation and in the case of the vsp1, split the pads links creationg from
the entities initialization logic as it was made for the OMAP3 ISP driver.

Unfortunately I don't have hardware to test these patches and they were
only build tested. So testing that I didn't introduce any regression will
be highly appreciated.

[0]: https://lkml.org/lkml/2015/8/26/453
[1]: http://www.spinics.net/lists/linux-samsung-soc/msg47089.html

Best regards,
Javier


Javier Martinez Canillas (5):
  [media] staging: omap4iss: separate links creation from entities init
  [media] v4l: vsp1: create pad links after subdev registration
  [media] v4l: vsp1: separate links creation from entities init
  [media] uvcvideo: create pad links after subdev registration
  [media] smiapp: create pad links after subdev registration

 drivers/media/i2c/smiapp/smiapp-core.c   |  20 +++---
 drivers/media/platform/vsp1/vsp1_drv.c   |  30 +---
 drivers/media/platform/vsp1/vsp1_rpf.c   |  29 +---
 drivers/media/platform/vsp1/vsp1_rwpf.h  |   5 ++
 drivers/media/platform/vsp1/vsp1_wpf.c   |  40 +++
 drivers/media/usb/uvc/uvc_entity.c   |  16 +++--
 drivers/staging/media/omap4iss/iss.c | 101 ++-
 drivers/staging/media/omap4iss/iss_csi2.c|  35 +++---
 drivers/staging/media/omap4iss/iss_csi2.h|   1 +
 drivers/staging/media/omap4iss/iss_ipipeif.c |  29 
 drivers/staging/media/omap4iss/iss_ipipeif.h |   1 +
 drivers/staging/media/omap4iss/iss_resizer.c |  29 
 drivers/staging/media/omap4iss/iss_resizer.h |   1 +
 13 files changed, 224 insertions(+), 113 deletions(-)

-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/18] staging: iio: hmc5843: Export missing SPI module alias information

2015-08-31 Thread Javier Martinez Canillas
Hello Jonathan,

On 08/22/2015 07:59 PM, Jonathan Cameron wrote:
> On 20/08/15 08:07, Javier Martinez Canillas wrote:
>> The SPI core always reports the MODALIAS uevent as "spi:"
>> regardless of the mechanism that was used to register the device
>> (i.e: OF or board code) and the table that is used later to match
>> the driver with the device (i.e: SPI id table or OF match table).
>>
>> So drivers needs to export the SPI id table and this be built into
>> the module or udev won't have the necessary information to autoload
>> the needed driver module when the device is added.
>>
>> Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>
> Applied to the togreg branch of iio.git.
> 
> This is too late for the upcoming merge window so it will be queued up for
> the next one.
>

IMHO this patch and "[PATCH 01/18] iio: Export SPI module alias
information in missing drivers" [0] are fixing broken module
autoloading which are bugs so are material for the 4.3 -rc cycle.
 
> Thanks,
> 
> Jonathan

[0]: https://lkml.org/lkml/2015/8/20/111

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: ste_rmi4: Remove unnecessary MODULE_ALIAS()

2015-08-30 Thread Javier Martinez Canillas
The driver has a I2C device id table that is used to create the modaliases
which already contains synaptics_rmi4_ts. So the alias is not needed.

Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com

---

 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 1f9ba8beb061..824d460911ec 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1138,4 +1138,3 @@ module_i2c_driver(synaptics_rmi4_driver);
 MODULE_LICENSE(GPL v2);
 MODULE_AUTHOR(naveen.gaddip...@stericsson.com, js...@stericsson.com);
 MODULE_DESCRIPTION(synaptics rmi4 i2c touch Driver);
-MODULE_ALIAS(i2c:synaptics_rmi4_ts);
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/18] staging: mt29f_spinand: Export OF module alias information

2015-08-20 Thread Javier Martinez Canillas
The SPI core always reports the MODALIAS uevent as spi:modalias
regardless of the mechanism that was used to register the device
(i.e: OF or board code) and the table that is used later to match
the driver with the device (i.e: SPI id table or OF match table).

So drivers needs to export the SPI id table and this be built into
the module or udev won't have the necessary information to autoload
the needed driver module when the device is added.

But this means that OF-only drivers needs to have both OF and SPI id
tables that have to be kept in sync and also the dev node compatible
manufacturer prefix is stripped when reporting the MODALIAS. Which can
lead to issues if two vendors use the same SPI device name for example.

To avoid the above, the SPI core behavior may be changed in the future
to not require an SPI device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table even when
is unused now to prevent breaking module loading when the core changes.

Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com
---

 drivers/staging/mt29f_spinand/mt29f_spinand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c 
b/drivers/staging/mt29f_spinand/mt29f_spinand.c
index ad30ce4206ef..1aa449e5fecf 100644
--- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
+++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
@@ -941,6 +941,7 @@ static const struct of_device_id spinand_dt[] = {
{ .compatible = spinand,mt29f, },
{}
 };
+MODULE_DEVICE_TABLE(of, spinand_dt);
 
 /*
  * Device name structure description
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] [media] staging: omap4iss: get entity ID using media_entity_id()

2015-08-20 Thread Javier Martinez Canillas
Hello Laurent,

On 08/21/2015 02:15 AM, Laurent Pinchart wrote:
 Hi Javier,
 
 On Friday 21 August 2015 02:14:05 Javier Martinez Canillas wrote:
 On 08/20/2015 08:37 PM, Laurent Pinchart wrote:
 On Wednesday 19 August 2015 17:35:19 Javier Martinez Canillas wrote:
 The struct media_entity does not have an .id field anymore since
 now the entity ID is stored in the embedded struct media_gobj.

 This caused the omap4iss driver fail to build. Fix by using the
 media_entity_id() macro to obtain the entity ID.

 Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com

 This looks fine to me. The patch needs to be moved between Mauro's 1/8 and
 2/8 patches to avoid breaking bisection with patch 3/8. I'd squash this
 patch and 2/4 into a single media: Use media_entity_id() in drivers
 patch.

 Yes, Hans and Mauro already mentioned it and I completely agree that
 should be squashed with Mauro's patch to maintain git bisect-ability.
 
 I wouldn't squash patches 1/4 and 2/4 into Mauro's 3/8 patch as Hans 
 proposed, 
 but instead squashing them together into a single patch and move the result 
 as 
 1.5/8 in Mauro's series.
 

I see. I don't mind either option tbh, I'm OK with whatever works better.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] [media] staging: omap4iss: get entity ID using media_entity_id()

2015-08-20 Thread Javier Martinez Canillas
Hello Laurent,

On 08/20/2015 08:37 PM, Laurent Pinchart wrote:
 Hi Javier,
 
 Thank you for the patch.
 
 On Wednesday 19 August 2015 17:35:19 Javier Martinez Canillas wrote:
 The struct media_entity does not have an .id field anymore since
 now the entity ID is stored in the embedded struct media_gobj.

 This caused the omap4iss driver fail to build. Fix by using the
 media_entity_id() macro to obtain the entity ID.

 Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com
 
 This looks fine to me. The patch needs to be moved between Mauro's 1/8 and 
 2/8 
 patches to avoid breaking bisection with patch 3/8. I'd squash this patch and 
 2/4 into a single media: Use media_entity_id() in drivers patch.
 

Yes, Hans and Mauro already mentioned it and I completely agree that
should be squashed with Mauro's patch to maintain git bisect-ability.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/4] [media] Media entity cleanups and build fixes

2015-08-20 Thread Javier Martinez Canillas
Hello Hans,

On 08/20/2015 02:41 PM, Hans Verkuil wrote:
 On 08/19/15 17:35, Javier Martinez Canillas wrote:
 Hello,

 This series contains a couple of build fixes and cleanups for the
 Media Controller framework. The goal of the series is to get rid of
 the struct media_entity .parent member since now that a media_gobj is
 embedded into entities, the media_gobj .mdev member can be used to
 store a pointer to the parent struct media_device.

 So the .parent field becomes redundant and can be removed after all
 the users are converted to use entity .graph_obj.mdev instead.

 Patches 1/4 and 2/4 are build fixes I found while build testing if no
 regressions were introduced by the conversion. Patch 3/4 converts
 all the drivers and the MC core to use .mdev instead of .parent and
 finally patch 4/4 removes the .parent field since now is unused.
 
 Regarding patches 1 and 2: these should of course be merged with Mauro's
 patches that make this particular change (patch 3/8), otherwise it would
 break git bisect.
 
 Anyway,
 
 Acked-by: Hans Verkuil hans.verk...@cisco.com for the changes in patch

Thanks a lot for the acks.

 1 and 2, as long as they are added to Mauro's patch 3/8.


Indeed, I completely agree that these should be squashed with
Mauro's patch to maintain git bisect-ability.
 
 Regards,
 
   Hans
 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/18] Export SPI and OF module aliases in missing drivers

2015-08-20 Thread Javier Martinez Canillas
Hello Brian,

On 08/20/2015 11:11 PM, Brian Norris wrote:
 On Thu, Aug 20, 2015 at 09:07:13AM +0200, Javier Martinez Canillas wrote:
 Patches #1 and #2 solves a), patches #3 to #8 solves b) and patches
 
 ^^^ I'm dying to know how this sentence ends :)


Sigh, I did some last minute restructuring of the cover letter and
seems I missed a sentence. I meant to said:

and patches #9 to #17 solves c).
 
 Patch #18 changes the logic of spi_uevent() to report an OF modalias if
 the device was registered using OF. But this patch is included in the
 series only as an RFC for illustration purposes since changing that
 without first applying all the other patches in this series, will break
 module autoloading for the drivers of devices registered using OF but
 that lacks an of_match_table. I'll repost patch #18 once all the patches
 in this series have landed.
 
 On a more productive note, the patches I've looked at look good to me.
 The missing aliases are a problem enough that should be fixed (i.e.,
 part (b)). I'll leave the SPI framework changes to others to comment on.


Great, thanks a lot for your feedback.
 
 Brian
 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/4] [media] Media entity cleanups and build fixes

2015-08-19 Thread Javier Martinez Canillas
Hello,

This series contains a couple of build fixes and cleanups for the
Media Controller framework. The goal of the series is to get rid of
the struct media_entity .parent member since now that a media_gobj is
embedded into entities, the media_gobj .mdev member can be used to
store a pointer to the parent struct media_device.

So the .parent field becomes redundant and can be removed after all
the users are converted to use entity .graph_obj.mdev instead.

Patches 1/4 and 2/4 are build fixes I found while build testing if no
regressions were introduced by the conversion. Patch 3/4 converts
all the drivers and the MC core to use .mdev instead of .parent and
finally patch 4/4 removes the .parent field since now is unused.

The series depend on Mauro's [PATCH v6 0/8] MC preparation patches
series [0].

The transformation were automated using a coccinelle semantic patch
and the drivers were build tested using allyesconfig and x-building
the ARM Exynos and OMAP defconfigs + the needed media config options.

Best regards,
Javier

[0]: http://www.mail-archive.com/linux-media@vger.kernel.org/msg91330.html


Javier Martinez Canillas (4):
  [media] staging: omap4iss: get entity ID using media_entity_id()
  [media] omap3isp: get entity ID using media_entity_id()
  [media] media: use entity.graph_obj.mdev instead of .parent
  [media] media: remove media entity .parent field

 drivers/media/media-device.c   |  8 ++---
 drivers/media/media-entity.c   | 34 --
 drivers/media/platform/exynos4-is/fimc-isp-video.c |  6 ++--
 drivers/media/platform/exynos4-is/fimc-lite.c  |  8 ++---
 drivers/media/platform/exynos4-is/media-dev.c  |  2 +-
 drivers/media/platform/exynos4-is/media-dev.h  |  8 ++---
 drivers/media/platform/omap3isp/isp.c  | 11 ---
 drivers/media/platform/omap3isp/ispccdc.c  |  2 +-
 drivers/media/platform/omap3isp/ispvideo.c | 10 ---
 drivers/media/platform/vsp1/vsp1_video.c   |  2 +-
 drivers/media/platform/xilinx/xilinx-dma.c |  2 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c|  6 ++--
 drivers/staging/media/omap4iss/iss.c   |  6 ++--
 drivers/staging/media/omap4iss/iss_video.c |  4 +--
 include/media/media-entity.h   |  1 -
 15 files changed, 58 insertions(+), 52 deletions(-)

-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] [media] staging: omap4iss: get entity ID using media_entity_id()

2015-08-19 Thread Javier Martinez Canillas
The struct media_entity does not have an .id field anymore since
now the entity ID is stored in the embedded struct media_gobj.

This caused the omap4iss driver fail to build. Fix by using the
media_entity_id() macro to obtain the entity ID.

Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com
---

 drivers/staging/media/omap4iss/iss.c   | 2 +-
 drivers/staging/media/omap4iss/iss_video.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss.c 
b/drivers/staging/media/omap4iss/iss.c
index f32ab7b98ae2..7226553ceb2f 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -607,7 +607,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
 * crashed. Mark it as such, the ISS will be reset when
 * applications will release it.
 */
-   iss-crashed |= 1U  subdev-entity.id;
+   iss-crashed |= 1U  media_entity_id(subdev-entity);
failure = -ETIMEDOUT;
}
}
diff --git a/drivers/staging/media/omap4iss/iss_video.c 
b/drivers/staging/media/omap4iss/iss_video.c
index bae67742706f..25e9e7a6b99d 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -784,7 +784,7 @@ iss_video_streamon(struct file *file, void *fh, enum 
v4l2_buf_type type)
entity = video-video.entity;
media_entity_graph_walk_start(graph, entity);
while ((entity = media_entity_graph_walk_next(graph)))
-   pipe-entities |= 1  entity-id;
+   pipe-entities |= 1  media_entity_id(entity);
 
/* Verify that the currently configured format matches the output of
 * the connected subdev.
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] [media] media: use entity.graph_obj.mdev instead of .parent

2015-08-19 Thread Javier Martinez Canillas
The struct media_entity has a .parent field that stores a pointer
to the parent struct media_device. But recently a media_gobj was
embedded into the entities and since struct media_gojb already has
a pointer to a struct media_device in the .mdev field, the .parent
field becomes redundant and can be removed.

This patch replaces all the usage of .parent by .graph_obj.mdev so
that field will become unused and can be removed on a later patch.

No functional changes.

The transformation was made using the following coccinelle spatch:

@@
struct media_entity *me;
@@

- me-parent
+ me-graph_obj.mdev

@@
struct media_entity *link;
@@

- link-source-entity-parent
+ link-source-entity-graph_obj.mdev

@@
struct exynos_video_entity *ve;
@@

- ve-vdev.entity.parent
+ ve-vdev.entity.graph_obj.mdev

Suggested-by: Mauro Carvalho Chehab mche...@osg.samsung.com
Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com
---

 drivers/media/media-device.c   |  8 ++---
 drivers/media/media-entity.c   | 34 --
 drivers/media/platform/exynos4-is/fimc-isp-video.c |  6 ++--
 drivers/media/platform/exynos4-is/fimc-lite.c  |  8 ++---
 drivers/media/platform/exynos4-is/media-dev.c  |  2 +-
 drivers/media/platform/exynos4-is/media-dev.h  |  8 ++---
 drivers/media/platform/omap3isp/isp.c  |  4 +--
 drivers/media/platform/omap3isp/ispvideo.c |  2 +-
 drivers/media/platform/vsp1/vsp1_video.c   |  2 +-
 drivers/media/platform/xilinx/xilinx-dma.c |  2 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c|  6 ++--
 drivers/staging/media/omap4iss/iss.c   |  4 +--
 drivers/staging/media/omap4iss/iss_video.c |  2 +-
 13 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 0f3844470147..138b18416460 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -435,8 +435,8 @@ int __must_check media_device_register_entity(struct 
media_device *mdev,
int i;
 
/* Warn if we apparently re-register an entity */
-   WARN_ON(entity-parent != NULL);
-   entity-parent = mdev;
+   WARN_ON(entity-graph_obj.mdev != NULL);
+   entity-graph_obj.mdev = mdev;
 
spin_lock(mdev-lock);
/* Initialize media_gobj embedded at the entity */
@@ -471,7 +471,7 @@ EXPORT_SYMBOL_GPL(media_device_register_entity);
 void media_device_unregister_entity(struct media_entity *entity)
 {
int i;
-   struct media_device *mdev = entity-parent;
+   struct media_device *mdev = entity-graph_obj.mdev;
 
if (mdev == NULL)
return;
@@ -484,7 +484,7 @@ void media_device_unregister_entity(struct media_entity 
*entity)
media_gobj_remove(entity-graph_obj);
list_del(entity-list);
spin_unlock(mdev-lock);
-   entity-parent = NULL;
+   entity-graph_obj.mdev = NULL;
 }
 EXPORT_SYMBOL_GPL(media_device_unregister_entity);
 
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 35e52cd1fc5a..a23c93369a04 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -332,7 +332,7 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_next);
 __must_check int media_entity_pipeline_start(struct media_entity *entity,
 struct media_pipeline *pipe)
 {
-   struct media_device *mdev = entity-parent;
+   struct media_device *mdev = entity-graph_obj.mdev;
struct media_entity_graph graph;
struct media_entity *entity_err = entity;
int ret;
@@ -387,7 +387,7 @@ __must_check int media_entity_pipeline_start(struct 
media_entity *entity,
 
ret = entity-ops-link_validate(link);
if (ret  0  ret != -ENOIOCTLCMD) {
-   dev_dbg(entity-parent-dev,
+   dev_dbg(entity-graph_obj.mdev-dev,
link validation failed for \%s\:%u 
- \%s\:%u, error %d\n,
link-source-entity-name,
link-source-index,
@@ -401,7 +401,7 @@ __must_check int media_entity_pipeline_start(struct 
media_entity *entity,
 
if (!bitmap_full(active, entity-num_pads)) {
ret = -EPIPE;
-   dev_dbg(entity-parent-dev,
+   dev_dbg(entity-graph_obj.mdev-dev,
\%s\:%u must be connected by an enabled 
link\n,
entity-name,
(unsigned)find_first_zero_bit(
@@ -454,7 +454,7 @@ EXPORT_SYMBOL_GPL(media_entity_pipeline_start);
  */
 void media_entity_pipeline_stop(struct media_entity *entity)
 {
-   struct media_device *mdev = entity-parent;
+   struct media_device *mdev = entity-graph_obj.mdev;
struct media_entity_graph graph