mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
greybus: switch to the term "manifest"
We agreed to rename a few things to improve clarity. This patch implements one of those changes. The blob of data that describes what's relevant to Greybus within an Ara module will now be called the "module manifest." In addition, in the context of Greybus we'll also be calling what's in an Ara module a "module" or "Greybus module." So this patch renames some structures and updates some comments. It also renames "greybus_desc.h" to be "greybus_manifest.h", and renames greybus_new_device() to be greybus_new_module(). Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
d9d077fdbc
commit
05ad189c23
@ -17,7 +17,7 @@
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/device.h>
|
||||
#include "svc_msg.h"
|
||||
#include "greybus_desc.h"
|
||||
#include "greybus_manifest.h"
|
||||
#include "greybus.h"
|
||||
|
||||
struct ap_msg {
|
||||
|
@ -344,16 +344,16 @@ static int create_cport(struct greybus_device *gdev,
|
||||
}
|
||||
|
||||
/**
|
||||
* greybus_new_device:
|
||||
* greybus_new_module:
|
||||
*
|
||||
* Pass in a buffer that _should_ be a set of greybus descriptor fields and spit
|
||||
* out a greybus device structure.
|
||||
* Pass in a buffer that _should_ contain a Greybus module manifest
|
||||
* and spit out a greybus device structure.
|
||||
*/
|
||||
struct greybus_device *greybus_new_device(struct device *parent,
|
||||
struct greybus_device *greybus_new_module(struct device *parent,
|
||||
int module_number, u8 *data, int size)
|
||||
{
|
||||
struct greybus_device *gdev;
|
||||
struct greybus_descriptor_block_header *block;
|
||||
struct greybus_manifest_header *header;
|
||||
struct greybus_descriptor *desc;
|
||||
int retval;
|
||||
int overall_size;
|
||||
@ -361,8 +361,8 @@ struct greybus_device *greybus_new_device(struct device *parent,
|
||||
u8 version_major;
|
||||
u8 version_minor;
|
||||
|
||||
/* we have to have at _least_ the block header */
|
||||
if (size <= sizeof(struct greybus_descriptor_block_header))
|
||||
/* we have to have at _least_ the manifest header */
|
||||
if (size <= sizeof(struct greybus_manifest_header))
|
||||
return NULL;
|
||||
|
||||
gdev = kzalloc(sizeof(*gdev), GFP_KERNEL);
|
||||
@ -379,21 +379,21 @@ struct greybus_device *greybus_new_device(struct device *parent,
|
||||
device_initialize(&gdev->dev);
|
||||
dev_set_name(&gdev->dev, "%d", module_number);
|
||||
|
||||
block = (struct greybus_descriptor_block_header *)data;
|
||||
overall_size = le16_to_cpu(block->size);
|
||||
header = (struct greybus_manifest_header *)data;
|
||||
overall_size = le16_to_cpu(header->size);
|
||||
if (overall_size != size) {
|
||||
dev_err(parent, "size != block header size, %d != %d\n", size,
|
||||
overall_size);
|
||||
dev_err(parent, "size != manifest header size, %d != %d\n",
|
||||
size, overall_size);
|
||||
goto error;
|
||||
}
|
||||
|
||||
version_major = block->version_major;
|
||||
version_minor = block->version_minor;
|
||||
version_major = header->version_major;
|
||||
version_minor = header->version_minor;
|
||||
|
||||
// FIXME - check version major/minor here!
|
||||
|
||||
size -= sizeof(struct greybus_descriptor_block_header);
|
||||
data += sizeof(struct greybus_descriptor_block_header);
|
||||
size -= sizeof(struct greybus_manifest_header);
|
||||
data += sizeof(struct greybus_manifest_header);
|
||||
while (size > 0) {
|
||||
desc = (struct greybus_descriptor *)data;
|
||||
desc_size = le16_to_cpu(desc->header.size);
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/module.h>
|
||||
#include "greybus_id.h"
|
||||
#include "greybus_desc.h"
|
||||
#include "greybus_manifest.h"
|
||||
|
||||
|
||||
#define GREYBUS_DEVICE_ID_MATCH_DEVICE \
|
||||
@ -209,7 +209,7 @@ void greybus_deregister(struct greybus_driver *driver);
|
||||
|
||||
int greybus_disabled(void);
|
||||
|
||||
struct greybus_device *greybus_new_device(struct device *parent,
|
||||
struct greybus_device *greybus_new_module(struct device *parent,
|
||||
int module_number, u8 *data,
|
||||
int size);
|
||||
void greybus_remove_device(struct greybus_device *gdev);
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
struct greybus_descriptor_block_header {
|
||||
struct greybus_manifest_header {
|
||||
__le16 size;
|
||||
__u8 version_major;
|
||||
__u8 version_minor;
|
Loading…
Reference in New Issue
Block a user