Commit graph

70 commits

Author SHA1 Message Date
Erik Arfvidson c294ea31aa staging: unisys: visorbus change -1 return values
This patch changes the vague -1 return values to -EFAULT since
it would be the most appropriate, given that this error
would only occur in an unexpected bad offset field.
Resulting in a bad address.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:58:16 -07:00
Erik Arfvidson 8a1cca31ab staging: unisys: fix format string %Lx to %llx for u64
this patch fixes the following sonarqube issue.
%Lx in format string (no. 1) requires 'unsigned long long'
but the argument type is 'unsigned long long'

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09 14:15:18 +02:00
Erik Arfvidson 38d56c2fad staging: unisys: added display string size define
Display string size that is guaranteed to be no longer the 99 characters.

Don't use a magic number throughout the code, define it once and use it
throughout.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:09:37 -07:00
David Kershner 64938182e7 staging: unisys: remove wmb() in visordriver_remove_device
Don't need to have a wmb() in visordriver_remove_device. Also removed
an unnecessary check for drv being null.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin a22f57c650 staging: unisys: visorbus: replaced use of vague 'x' variable
In client_bus_info_show, the variable 'x' is used to create keep track
of the offset that the current 'pos' in the output buffer needs to be
incremented by. Since 'off' is already taken 'shift' was used since it's
used to shift the pointer.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin 8d7da1d8c2 staging: unisys: visorbus: replaced vague 'p' variable with 'pos'
In the case of client_bus_info_show, the variable 'p' was used to
indicate the position in the output buffer. This was changed to 'pos' to
indicate that it kept track of the current position in the output
buffer.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin 62f3dc8567 staging: unisys: visorbus: replaced vague variable name in zoneguid_show
The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_zoneid function. This
just replaces the name with "zoneid".

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin 48f571489c staging: unisys: visorbus: replaced vague variable name in typeguid_show
The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_id function. This
just replaces the name with "typeid".

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner 0b2acf34f3 staging: unisys: visorbus: rename create_visor_device gotos
Away is ambiguous when specifying error vs success. Make return labels
more meaningful by marking them as error paths.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner 8e33f48c95 staging: unisys: visorbus: Remove gotos in visorbus_match
Gotos in visorbus_match are not needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner 78af1aef66 staging: unisys: visorbus: fix up gotos in visorbus_init
This patch fixes the gotos in visorbus_init

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Tim Sell b750b05939 staging: unisys: visorbus: remove unused sysfs attribute devmajorminor/*
The sysfs attribute directory at:

    /sys/bus/visorbus/devices/vbus<x>:dev<y>/devmajorminor/*

or

    /sys/devices/visorbus<x>/vbus<x>:dev<y>/devmajorminor/*

previously provided a location where a visorbus function driver could
publish information (for usermode use) about possibly-multiple major and
minor device numbers for character devices created for a each visorbus
device, using visorbus_registerdevnode().  This functionality is not
currently used, so it has been removed by this cset.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner 4000622ec2 staging: unisys: visorbus: Fix up visordriver_probe
Fixup the visordriver_probe function. Rearrange the function to avoid
needing gotos and removed unnecessary wmb().

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar 2cda64cf69 staging: unisys: visorbus: Remove useless return variables
This patch removes unnecessary return variables and compresses the
return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:41:48 -08:00
Amitoj Kaur Chawla 8247bcb998 staging: unisys: visorbus: Remove unnecessary dev_set_drvdata()
Unnecessary dev_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct device *dev;
@@
- dev_set_drvdata(dev, NULL);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:41:48 -08:00
Benjamin Romer 03b93f08f8 staging: unisys: clean up initiate_chipset_device_pause_resume()
Simplify this function by removing the goto in favor of handling errors
immediately. Eliminate the vaguely-named variable x, and remove the
unneeded initialization of rc. Lastly, provide meaningful error values
to the callback function instead of just passing back a -1 for failure.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:40:52 -08:00
Benjamin Romer 7a9749be2f staging: unisys: remove pointless init of rc in chipset_device_create()
The value of rc is set by calling a function, so there's no need to
initialize it to -1, or anything at all.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:40:52 -08:00
Benjamin Romer c2c667d6bd staging: unisys: get rid of goto in create_bus_instance()
Remove the unnecessary rc and goto messiness, and just handle freeing
the memory before returning an error in the one place where that needs
to happen.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:40:52 -08:00
Benjamin Romer f99d3308c5 staging: unisys: cleanup rc -1 in create_visor_device()
Get rid of the rc = -1 initialization. Return a meaningful error on
failure in the function, or, the rc from a called function if it fails.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:40:52 -08:00
Benjamin Romer f748f64f06 staging: unisys: remove goto in get_vbus_header_info
Remove the rc, the = -1, and all the goto mess here and just return
directly with a meaningful error number.

The caller only cares about success/failure right now, that needs to be
addressed in a later patch series.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:40:52 -08:00
Benjamin Romer a5cff2b7d8 staging: unisys: fix return value for visorbus pci probe
Instead of returning -1, return -ENODEV when there is no probe function
found for the device.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:40:52 -08:00
Erik Arfvidson 7005c16cf2 staging: unisys: fix comments in visorbus_main.c
This patch fixes the following types of check patch warnings:
	Block comments use a trailing */ on a separate line
	Comment alignments

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:37:15 -08:00
Gavin O'Leary 4811789503 staging: unisys: visorbus: visorbus_main.c: made checkpatch warning-free
Made visorbus_main.c checkpatch warning-free by fixing the comment style
issues.

Signed-off-by: Gavin O'Leary <gavinoleary3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Benjamin Romer 6155a3cf11 staging: unisys: stop device registration before visorbus registration
In cases where visorbus is compiled directly into the kernel, if
visorbus registration fails for any reason, it is still possible for
other drivers to call visorbus_register_visor_driver(), which could
cause an oops. Prevent this by saving the result of the call to
create_bus() in a static variable, and return an error code when the bus
hasn't been registered successfully.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13 09:43:41 -07:00
David Kershner 418627ddc6 staging: unisys: visorbus: Unregister driver on error
If there is an error in registering driver attributes, unregister
the driver as well.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13 09:43:40 -07:00
Michał Kępień cf7281c9ae staging: unisys: make visorbus_dev_groups static
visorbus_dev_groups is not referenced outside visorbus_main.c, so it can
be declared static.

Found using sparse.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:56:54 -07:00
Shraddha Barke 0df4e3e9bb Staging: unisys: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:44:45 -07:00
Prarit Bhargava 59fd2c8bd1 drivers, staging, unisys Add modalias files to visorbus devices
This patch adds modalias files that export the device UUID type to sysfs
so that udev can autoload the appropriate device driver on demand.  Note
that is required a minor name change to the channel device sysfs files
which are currently named visorbus_dev_groups, and are now named
visorbus_channel_groups.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:08:11 -07:00
Benjamin Romer 6f14cc18f8 staging: unisys: fix copyright statements
The copyright statements in the drivers need to be correct and
consistent; this patch fixes the year for all of them, and makes the
statement text cover just the GPL V2.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-16 10:12:45 -07:00
Christophe JAILLET 216c3e2c13 staging: unisys: Reduce indent
Remove some extra tabs in order to improve readalibility.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 18:37:18 -07:00
Christophe JAILLET 0aa5ae1e2e staging: unisys: Use kzalloc instead of kmalloc/memset
This patch turns a kmalloc/memset into an equivalent kzalloc.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 18:37:18 -07:00
Tim Sell fd012d0def staging: unisys: correctly NULL-terminate visorbus sysfs attribute array
I'm not sure what adverse runtime effects the previously-omitted
NULL-termination would cause, but the code was definitely wrong.

Fixes: 795731627c ('staging: unisys: Clean up device sysfs attributes')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 18:36:48 -07:00
David Kershner 86ea8acc6b staging: unisys: Don't hold device responses until driver loads
Currently if a driver is not loaded for a device, we will not
respond to the device create until it is done. This causes
s-Par to not mark the partition running if the driver for the
device is not loaded. Since there are several devices that
could be assigned to a guest that don't have an actual
driver this will cause us to never go running.

If the device driver is loaded, we WILL continue to only
respond to the device PAUSE message when the device driver
has responded that it is done with the device.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:08:07 -07:00
Abdul Hussain df7f46e83c staging: unisys: Remove unneeded variable
This patch remove unneeded variable used to store return value.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:08:07 -07:00
Don Zickus 04dacacc14 staging: unisys: Fix clean up path
When unloading a module, we need to cleanup the platform registration.
However, unregistering the platform uncovered a couple of quirks, namely
a missing device_release function.  Fix things up so module unload works
and allows us to reload the module.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:44 -07:00
Don Zickus 75439a17d4 staging: unisys: Fix double sysfs create for module version
When we combined visorchipset and visorbus into one driver we negelected
to strip out some of the MODULE_ stuff from one of the files.  When
building the drivers in, it causes a WARN that we try to create
/proc/modules/visorbus/version when it is already created.

visorchipset.c is the driver entry point, remove the cruft from
visorbus_main.c.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:44 -07:00
Don Zickus a298bc0b59 staging: unisys: Convert device creation to use visor_device
This patch removes the legacy dev_info struct and instead creates
and passes around a traditional struct device.

This allows us to remove a lot of the various look up code and
removes the doubt if the struct exists or not.

Half of the churn is just the conversion of visorchipset_device_info
to visor_device.  Various cleanups include re-arranging the failure
paths to make more sense.

Pay attention to the create_visor_device function.  This had a lot of
churn to simplify everything.

Lots of functions disappeared because they are not needed any more.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:43 -07:00
Don Zickus d32517e392 staging: unisys: Convert bus creation to use visor_device
This patch removes the legacy bus_info struct and instead creates
and passes around a traditional struct device.

This allows us to remove a lot of the various look up code and
removes the doubt if the struct exists or not.

Half of the churn is just the conversion of visorchipset_bus_info
to visor_device.  Various cleanups include re-arranging the failure
paths to make more sense.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:43 -07:00
Don Zickus 65bd6e4607 staging: unisys: Do not use 0 as the default bus root device number
I used 0 as the device id for the bus root, neglecting the fact that
device 0 is a valid id in Unisys's configuration.  Modify this to
use UINT_MAX instead as a unique number.

As fallout from this change it was noticed the bus_no and dev_no was not
defined the same way consistently.  Fix visorbus.h to use u32 there.  Fix
the resulting printk warning too.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:43 -07:00
Don Zickus ee983d902e staging: unisys: Remove server flags
The bus driver doesn't work in server mode, just remove the left over
pieces.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:43 -07:00
Don Zickus 52c4cbd3fd staging: unisys: Remove unused cruft
Removing stuff that isn't being used.  Another prepartion patch to
allow us to use visor_device everywhere without the baggage of
bus/dev_info.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:43 -07:00
Don Zickus 343506bf0a staging: unisys: Migrate bus from devdata to visor_device
The bus device and regular device were using two different
structs.  Let's combine them as they are not entirely different
from one another.

This allows us to move this creation up the stack later and
actually remove bus/dev_info easily.

Most of the churn is just renaming devdata -> dev and 'struct
visorbus_devdata' to 'struct visor_device'.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:36:43 -07:00
Don Zickus 7726f81357 staging: unisys: Prepare vbus_hdr_info to be public
In order to remove bus_info, we need to migrate vbus_hdr_info into
the public namespace of visor_device.  Because the struct is private,
we use a void * to hide the contents.

As a result, we need to allocate vbus_hdr_info and manage it.

Also work around vbus_valid, as that variable will not be used
in the public namespace.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-02 14:22:49 +09:00
Don Zickus b32c4997c0 staging: unisys: Move channel creation up the stack
Instead of creating a channel struct to temporarily hold the channel
info and passing it through multiple functions until the device is
created, just create the channel from the start.

This allows us to remove the channel_info struct.

I noticed 'chan_info.addr_type' was not being used, so I just deleted it.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-02 14:22:49 +09:00
Drew Fustini f6758e7961 staging: unisys: visorbus: add static declarations
Add static declarations to statisfy sparse warnings in:
  drivers/staging/unisys/visorbus/visorbus_main.c

  warning: symbol 'visorbus_debug' was not declared
  warning: symbol 'visorbus_forcematch' was not declared
  warning: symbol 'visorbus_forcenomatch' was not declared
  warning: symbol 'visorbus_devicetest' was not declared
  warning: symbol 'visorbus_debugref' was not declared
  warning: symbol 'visorbus_bus_groups' was not declared
  warning: symbol 'devmajorminor_create_file' was not declared
  warning: symbol 'devmajorminor_remove_file' was not declared
  warning: symbol 'devmajorminor_remove_all_files' was not declared
  warning: symbol 'unregister_devmajorminor_attributes' was not declared

Signed-off-by: Drew Fustini <pdp7pdp7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 07:18:14 +09:00
Don Zickus b4b598fdde staging: unisys: Convert device functions to pass dev_info pointer around
Most device functions pass bus_no and dev_no around and then do a lookup
inside each function to find the dev_info struct.  Instead just pass the
pointer.

This prepares us for a later conversion to using visor device.

No real technical changes.  Just function header changes and little
cleanups as a result.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:30:31 -07:00
Don Zickus 3032aeddd8 staging: unisys: Convert bus functions to pass bus_info pointer around
Most bus functions pass bus_no around and then do a lookup inside each
function to find the bus_info struct.  Instead just pass the pointer.

This prepares us for a later conversion to using visor_device.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:28:56 -07:00
Don Zickus 5ecbd5d46d staging: unisys: Convert the device attributes to visor_device
Convert the device attribute files to properly use visor_device.
This removes a whole bunch of checks and assumptions and simplifies
the code.  Everything is straightforward.

No testing down as I can't mimic channel info correctl.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:28:56 -07:00
Don Zickus 1fb3016eab staging: unisys: Prep for removing 'info' structs
The visorbus driver has three _info structs lying around
(device, bus, channel) that store subsets of info from the
bigger structs.

Having these structs around make resource handling very difficult
and more complicated than it needs to be.  Use the device
infrastructure and instead pass 'struct visor_device' all
over the place.

In order to do that 'struct visor_device' needs to get smarter.
This patch adds the pieces to prep for it.  The new elements
will be used in later patches.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:28:55 -07:00
Don Zickus 795731627c staging: unisys: Clean up device sysfs attributes
Properly hook into the struct device groups element.  This allows the
core infrastructure to manage the files instead of the bus layer.  And
makes the code easier to read.

I didn't clean up the _show functions just modified them a bit to handle
the different args for now and to prevent a build warning.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:28:55 -07:00