Commit graph

273 commits

Author SHA1 Message Date
stephen knipe 57e60850e7 staging: most: dim2_hdm octal permissions fix
This patch is to make the permissions sent to module_param be
explicitly octal in accordance with the linux style conventions. Issues
found by checkpatch.pl.

Signed-off-by: stephen knipe <steve.knipe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:10:20 +01:00
Zhengyi Shen e495fac839 staging:most/hdm-i2c: Replace symbolic permissions with octal permissions
WARNING: Symbolic permissions 'S_IRUGO' are not preferred.
Consider using octal permissions '0444'.
This warning was detected by checkpatch.pl for hdm_i2c.c.

Signed-off-by: Zhengyi Shen <shenzhengyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:38 +01:00
Sebastian Haas f3147b66a8 staging: most: hdm-usb: fix symbolic permissions warning
Replace symbolic permissions with their octect representation to fix
checkpatch warnings.

Signed-off-by: Sebastian Haas <sehaas@deebas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-27 09:40:56 +01:00
Eric Salem 5a10380bfb staging: most: hdm-usb: Fix mismatch between types used in sizeof operator
Fixed mismatch between types used in sizeof operator.

Signed-off-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-16 18:08:56 +01:00
Ramiro Oliveira cbe50fc432 staging: most: change dma_buf variable to __le16
dma_buf is being cast to __le16 *, but it was defined as u16 *.
sparse reported this error as:
drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: cast to restricted
__le16

This patch changes dma_buf from u16 to __le16.

Signed-off-by: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:48:03 +01:00
Jason Litzinger 7e47629e7a staging: most: Eliminate usage of symbolic permissions
Fix checkpatch warnings regarding the use of symbolic permissions.

Where the MOST_CHANNEL_ATTR macro is used, convert to octal
permissions over symbolic.

Where _ATTR is used directly, replace with _ATTR_RW/_ATTR_WO and
update the show/store function names appropriately.

Signed-off-by: Jason Litzinger <jlitzingerdev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-29 21:57:14 +01:00
Christian Gromm 25e3854c83 staging: most: hdm-usb: add comment
This patch adds a comment to function hdm_configure_channel() to clarify
its execution paths.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-30 11:09:02 -04:00
Andrey Shvetsov e33269f60a staging: most: hdm-usb: introduce synchronization function
This patch introduces the function start_sync_ep() and relocates the
triggers for synchronization to this function.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:12:09 +02:00
Andrey Shvetsov 7c23baa90d staging: most: hdm-usb: do h/w specific synchronization at configuration time
This patch puts the synchronization procedure trigger for asynchronous
channels into the function hdm_configure_channel. Likewise, it removes
triggering of hardware specific synchronization for other channel types
from the probe function as it is not required.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:12:08 +02:00
Andrey Shvetsov 1e80e19ce9 staging: most: aim-networking: keep channels closed if ndo_open fails
This patch stops all started channels whenever the function most_nd_open
returns an error. Additionally, it renames variable wait_res to ret for
the consistency.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:12:08 +02:00
Andrey Shvetsov 3a542007fd staging: most: hdm-usb: fix mbo buffer leak
This patch fixes an MBO leak by replacing the proprietary
free_anchored_buffers() function with the usb_kill_anchored_urbs() function
of the USB subsystem and guarantees that the mbo->complete() completion
function is being called for each URB.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:14 +02:00
Andrey Shvetsov 02245b6077 staging: most: hdm-dim2: remove tracing of mac address
This patch removes tracing of the MAC address from the DIM2 HDM as it is
already done in the networking AIM.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:13 +02:00
Andrey Shvetsov f28e6cd3ac staging: most: hdm-usb: remove filtering of networking state
In case the networking interface goes down and up again, the USB HDM does
not report the state the MOST networking interface controller is in. This
might lead to nonfunctional network.

Since the networking AIM already takes care of hardware address checking
and tracing it can be removed from the HDM USB, which is what this patch is
doing.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:13 +02:00
Andrey Shvetsov 812b55e531 staging: most: aim-network: avoid calling netdev_info()
This patch removes the needless call of function netdev_info() from
function most_nd_setup().

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:12 +02:00
Andrey Shvetsov 81ad520786 staging: most: aim-network: setup mac address before ifup has finished
The networking AIM implements a non-standard behavior as it starts the
networking interface with an invalid MAC address and changes it by the time
a valid one is available.

This patch introduces a completion object to set the MAC address of the
networking interface before the .ndo_open callback (ifup) of the net_device
returns.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:12 +02:00
Andrey Shvetsov 553a42e51a staging: most: aim-network: fix startup scenario.
In case the networking interface (running on MediaLB) is being started
before the MOST network is, it remains disabled even after the MOST network
has transitioned to active mode.

This patch removes the dependency on the MOST link status to keep the
networking queue active and the networking interface working for the
case described above.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:11 +02:00
Andrey Shvetsov eefb2a845c staging: most: core: update examples on how to link channels
This patch updates the comments with examples on how to use the "add_link"
and "remove_link" properties.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:11 +02:00
Andrey Shvetsov 5d7df3ae4c staging: most: core: remove processing of deprecated names
The USB HDM does not use the "@" character for channel names anymore. This
patch cleans up the code processing such names and adapts the corresponding
examples on how to use the properties "add_link" and "remove_link".

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:10 +02:00
Andrey Shvetsov 931161b714 staging: most: core: remove read option from remove_link
The attribute "remove_link" returns the latest link that has been removed
of a certain channel. Since this piece information isn't particulary
useful this patch is going to remove it.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:10 +02:00
Andrey Shvetsov 7b518be47d staging: most: core: remove member add_link
This patch removes the unused field add_link of struct most_aim_obj.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:09 +02:00
Bhumika Goyal d983c59775 Staging: most: hdm-dim2: constify attribute_group structures
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
(
sysfs_remove_group(e1,&i@p)
|
sysfs_create_group(e1,&i@p)
)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text	   data	    bss	    dec	    hex	filename
    509	    160	      0	    669	    29d
drivers/staging/most/hdm-dim2/dim2_sysfs.o

File size after:
   text	   data	    bss	    dec	    hex	filename
    565	     96	      0	    661	    295
drivers/staging/most/hdm-dim2/dim2_sysfs.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:24:00 +02:00
Bhumika Goyal af2708f5e8 Staging: most: aim-v4l2: constify v4l2_file_operations structures
Check for v4l2_file_operations structures that are only stored in the
fops field of video_device structures. As this field is constant, so
v4l2_file_operations structures having this property can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct v4l2_file_operations i@p = {...};

@ok1@
identifier r1.i;
position p;
struct video_device x;
@@
x.fops=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct v4l2_file_operations i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct v4l2_file_operations i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   5608	    160	      4	   5772	   168c
drivers/staging/most/aim-v4l2/video.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5696	     96	      4	   5796	   16a4
drivers/staging/most/aim-v4l2/video.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:06:55 +02:00
Bhumika Goyal cfb459edaa Staging: most: aim-sound: constify snd_pcm_ops structures
Check for snd_pcm_ops structures that are only passed as the third
argument to the function snd_pcm_set_ops. As this argument is
constant, so snd_pcm_ops structures having this property can also be
made constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
snd_pcm_set_ops(e1,e2,&i@p)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct snd_pcm_ops i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_pcm_ops i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   4963	    192	     16	   5171	   1433
drivers/staging/most/aim-sound/sound.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5075	     64	     16	   5155	   1423
drivers/staging/most/aim-sound/sound.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:06:55 +02:00
Wei Yongjun ca8b3fa7ea staging: most: fix error return code in audio_probe_channel()
Fix to return a negative error code from the audio_set_hw_params() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:06:55 +02:00
Christian Gromm da2c08714c staging: most: aim-cdev: make syscall write accept buffers of arbitrary size
This patch allows to call the write() function for synchronous and
isochronous channels with buffers of any size. The AIM simply waits for
data to fill up the MOST buffer object according to the network interface
controller specification for streaming channels, before it submits the
buffer to the HDM.

The new behavior is backward compatible to the old applications, since
all known applications needed to fill the buffer completely anyway.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-23 19:00:44 +02:00
Andrey Shvetsov 0540609fe2 staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC
This patch replaces the enum value MOST_CH_ISOC_AVP with the more
appropriate MOST_CH_ISOC.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22 11:54:47 +02:00
Christian Gromm 95f73013ed staging: most: clean up configuration strings
This patch adds the strings 'rx', 'tx' and 'isoc' to the list of accepted
identifiers when setting up a channel configuration. To keep consistency it
removes the prefix "dir_" from strings returned by the attributes
set_direction and available_directions and it removes the suffix "_avp"
from the string "isoc_avp" returned by the attributes set_datatype and
available_datatypes.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22 11:54:47 +02:00
Andrey Shvetsov 22ff195b5a staging: most: core: remove trailing zero from text property
This patch removes trailing zeros from the strings returned by the
attributes available_datatypes and available_directions.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22 11:54:46 +02:00
Christian Gromm a6f9d846cc staging: most: make function most_submit_mbo return void
Function most_submit_mbo() causes an exception only if either the pointer
mbo or mbo->context equals NULL. From the underlying architecture's point
of view both cases must _not_ come true and would happen only, if something
has tampered with the pointers. This would render runtime code unable to
recover anyway. So, instead trying to hide that things are already
critically out of control we're better off with a WARN_ON() assertion.

This patch replaces the return type of the function most_submit_mbo() with
'void' and adds a WARN_ONCE() assertion. Additionally, code calling the
function is adapted accordingly.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22 11:54:46 +02:00
Eva Rachel Retuya 520a28443f staging: most: hdm-usb: convert pr_warn() to dev_warn()
Replace pr_warn() call with its respective dev_warn() counterpart.
Semantic patch used to detect and apply the transformation:

@a@
identifier dev;
expression E;
@@

	struct device *dev = E;
	<+... when != dev == NULL
- pr_warn(
+ dev_warn(dev,
		...);
	...+>

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:59:45 +02:00
Christian Gromm 88d1878bca staging: most: hdm-usb: rename channel related spinlock
To increase comprehension this patch renames the channel related
spinlock with a more fitting name.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 08:39:42 +02:00
Christian Gromm 3fbcb92b74 staging: most: hdm-usb: remove calls to usb_unachor_urb
This patch removes the calls to usb_unanchor_urb() from the completion
routines, since disassociation of the URBs is already handles by the
USB subsystem.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 08:39:42 +02:00
Christian Gromm d223b37c9f staging: most: hdm-usb: remove redundant spinlocks
This patch removes the spinlocks when accessing the usb_anchor list,
because the struct usb_anchor is using its own lock.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 08:39:42 +02:00
Christian Gromm 27e6245e35 staging: most: hdm-usb: remove proprietary urb anchoring
This patch removes the propietary tracking of URBs. Instead the structure
usb_anchor of the USB subsystem is used.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 08:39:42 +02:00
Andrey Shvetsov 8f5334651a staging: most: hdm-dim2: monitor atx DBR space
This patch implements a workaround for a DIM2 issue where the device
macro, in case the asynchronous channel sends data (to MOST), sporadically
duplicates the synchronous blocks with a size of half the synchronous DBR
buffer.

The patch monitors the size of the unused asynchronous Tx DBR memory
(that includes the ping and pong sizes) to prevent the potential DBR
overflow for the asynchronous Tx DBR buffer.

The patched DIM2 HDM expects that the platform driver delivers the 2nd
platform irq (index 1) as the mlb_int of the DIM2 macro.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov a0adbc7a81 staging: most: hdm-dim2: fix dim2-ip interrupt names
This patch fixes the DIM2 IP interrupt names.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov 3512ede28e staging: most: hdm-dim2: remove clearance of pending MLB interrupt
This patch removes unnecessary clearing of a pending mlb_int from the
service routine for ahb interrupt.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov cad29b4b20 staging: most: hdm-dim2: delete error code from logging message
This patch removes the logging of the returned error code of function
dim2_probe as it is done by the calling function.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov 055f1d12da staging: most: hdm-dim2: rename function
This patch renames the function dim_service_irq. It subsitutes the name
with the more suitable identifier dim_service_ahb_int_irq.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov 52076fe26c staging: most: hdm-dim2: remove structure member
This patch removes the member irq_ahb0 of the structure dim2_hdm, since
its job is suitably done by a simple auto variable.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov a85ee2aa99 staging: most: hdm-dim2: round up DBR memory for async/ctrl
As the DBR memory is allocated in units of DBR_BLOCK_SIZE, it is more
efficient to configure the DIM2 IP to use whole blocks of the DBR memory.
This patch ceils the DBR memory size used by the DIM2 IP for async/ctrl
channels.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov 6631c5c9b0 staging: most: hdm-dim2: double size of DBR buffer
This patch increases the size of the asynchronous and control DBR buffers
in the Tx path to twice the max. message size. This patch is needed to
increase the throughput for big messages.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov 9b762fdfe2 staging: most: hdm-dim2: relocate variable declarations
This patch eliminates nested variable declarations by putting them at
the beginning of the function in order to flatten the code.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:29 +02:00
Andrey Shvetsov 424a679997 staging: most: hdm-dim2: remove macro ENABLE_HDM_TEST
This patch removes the macro ENABLE_HDM_TEST, which was needed while
doing DIM2-HAL simulations. But these are not conducted anymore.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:28 +02:00
Andrey Shvetsov 55f142ca5f staging: most: hdm-dim2: fix channel configuration
The DIM2 HDM checks the parameters passed to the function
configure_channel() and adapts the buffer sizes of the configuration
according to the hardware limitation. This patch is needed to init
the HAL layer with the correct values.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 19:23:28 +02:00
Andrey Shvetsov 602facfd96 staging: most: core: constify structure member
This patch adds the const qualifier to the declaration of the member
name_suffix of structure most_channel_capability. It is needed since it
points to string literals.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 15:01:29 +02:00
Christian Gromm bc5f96a156 staging: most: core: show all linked channels
This patch is needed to have all linked channels being reported by the
show() function of the attribute file add_link. Currently user space can
only read back the latest link that has been established to a certain
channel.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 15:01:29 +02:00
Christian Gromm 98a3c4d7ae staging: most: hdm-usb: remove repeated access to structure
This patch removes the repeated access to a struct member by assigning
its value to a local variable once.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 09:47:15 +02:00
Andrey Shvetsov 3e2880bee5 staging: most: hdm-usb: remove reference to read function in write only macro
This patch replaces the reference to the function show_value() with
NULL in the macro MOST_DCI_WO_ATTR used for the write only attributes.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 09:47:15 +02:00
Andrey Shvetsov ac33fbb865 staging: most: hdm-usb: initialize variables by declaration
This patch moves initialization of the variables to the declaration
where possible.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 09:47:15 +02:00