cregit-Linux how code gets into the kernel

Release 4.11 drivers/staging/greybus/audio_manager_sysfs.c

/*
 * Greybus operations
 *
 * Copyright 2015-2016 Google Inc.
 *
 * Released under the GPLv2 only.
 */

#include <linux/string.h>
#include <linux/sysfs.h>

#include "audio_manager.h"
#include "audio_manager_private.h"


static ssize_t manager_sysfs_add_store( struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { struct gb_audio_manager_module_descriptor desc = { {0} }; int num = sscanf(buf, "name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s " "vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X", desc.name, &desc.vid, &desc.pid, &desc.intf_id, &desc.ip_devices, &desc.op_devices); if (num != 7) return -EINVAL; num = gb_audio_manager_add(&desc); if (num < 0) return -EINVAL; return count; }

Contributors

PersonTokensPropCommitsCommitProp
Svetlin Ankov9891.59%125.00%
Vaibhav Agarwal76.54%125.00%
Pankaj Bharadiya21.87%250.00%
Total107100.00%4100.00%

static struct kobj_attribute manager_add_attribute = __ATTR(add, 0664, NULL, manager_sysfs_add_store);
static ssize_t manager_sysfs_remove_store( struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int id; int num = kstrtoint(buf, 10, &id); if (num != 1) return -EINVAL; num = gb_audio_manager_remove(id); if (num) return num; return count; }

Contributors

PersonTokensPropCommitsCommitProp
Svetlin Ankov6597.01%150.00%
Elise Lennion22.99%150.00%
Total67100.00%2100.00%

static struct kobj_attribute manager_remove_attribute = __ATTR(remove, 0664, NULL, manager_sysfs_remove_store);
static ssize_t manager_sysfs_dump_store( struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int id; int num = kstrtoint(buf, 10, &id); if (num == 1) { num = gb_audio_manager_dump_module(id); if (num) return num; } else if (!strncmp("all", buf, 3)) { gb_audio_manager_dump_all(); } else { return -EINVAL; } return count; }

Contributors

PersonTokensPropCommitsCommitProp
Svetlin Ankov8493.33%133.33%
Chase Metzger44.44%133.33%
Elise Lennion22.22%133.33%
Total90100.00%3100.00%

static struct kobj_attribute manager_dump_attribute = __ATTR(dump, 0664, NULL, manager_sysfs_dump_store);
static void manager_sysfs_init_attribute( struct kobject *kobj, struct kobj_attribute *kattr) { int err; err = sysfs_create_file(kobj, &kattr->attr); if (err) { pr_warn("creating the sysfs entry for %s failed: %d\n", kattr->attr.name, err); } }

Contributors

PersonTokensPropCommitsCommitProp
Svetlin Ankov50100.00%1100.00%
Total50100.00%1100.00%


void gb_audio_manager_sysfs_init(struct kobject *kobj) { manager_sysfs_init_attribute(kobj, &manager_add_attribute); manager_sysfs_init_attribute(kobj, &manager_remove_attribute); manager_sysfs_init_attribute(kobj, &manager_dump_attribute); }

Contributors

PersonTokensPropCommitsCommitProp
Svetlin Ankov34100.00%1100.00%
Total34100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Svetlin Ankov39295.84%116.67%
Vaibhav Agarwal71.71%116.67%
Chase Metzger40.98%116.67%
Elise Lennion40.98%116.67%
Pankaj Bharadiya20.49%233.33%
Total409100.00%6100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.