Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
  [PATCH] Added URI of "linux kernel development process"
  [PATCH] Kobject: possible cleanups
  [PATCH] Fix OCFS2 warning when DEBUG_FS is not enabled
  [PATCH] Kobject: fix build error
  [PATCH] Frame buffer: remove cmap sysfs interface
  • Loading branch information
Linus Torvalds committed Apr 27, 2006
2 parents a9aa0e2 + 5bd982e commit 2cb1459
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 101 deletions.
3 changes: 2 additions & 1 deletion Documentation/HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,8 @@ start exactly where you are now.


----------
Thanks to Paolo Ciarrocchi who allowed the "Development Process" section
Thanks to Paolo Ciarrocchi who allowed the "Development Process"
(http://linux.tar.bz/articles/2.6-development_process) section
to be based on text he had written, and to Randy Dunlap and Gerrit
Huizenga for some of the list of things you should and should not say.
Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers,
Expand Down
92 changes: 3 additions & 89 deletions drivers/video/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,94 +305,6 @@ static ssize_t show_stride(struct class_device *class_device, char *buf)
return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length);
}

/* Format for cmap is "%02x%c%4x%4x%4x\n" */
/* %02x entry %c transp %4x red %4x blue %4x green \n */
/* 256 rows at 16 chars equals 4096, the normal page size */
/* the code will automatically adjust for different page sizes */
static ssize_t store_cmap(struct class_device *class_device, const char *buf,
size_t count)
{
struct fb_info *fb_info = class_get_devdata(class_device);
int rc, i, start, length, transp = 0;

if ((count > PAGE_SIZE) || ((count % 16) != 0))
return -EINVAL;

if (!fb_info->fbops->fb_setcolreg && !fb_info->fbops->fb_setcmap)
return -EINVAL;

sscanf(buf, "%02x", &start);
length = count / 16;

for (i = 0; i < length; i++)
if (buf[i * 16 + 2] != ' ')
transp = 1;

/* If we can batch, do it */
if (fb_info->fbops->fb_setcmap && length > 1) {
struct fb_cmap umap;

memset(&umap, 0, sizeof(umap));
if ((rc = fb_alloc_cmap(&umap, length, transp)))
return rc;

umap.start = start;
for (i = 0; i < length; i++) {
sscanf(&buf[i * 16 + 3], "%4hx", &umap.red[i]);
sscanf(&buf[i * 16 + 7], "%4hx", &umap.blue[i]);
sscanf(&buf[i * 16 + 11], "%4hx", &umap.green[i]);
if (transp)
umap.transp[i] = (buf[i * 16 + 2] != ' ');
}
rc = fb_info->fbops->fb_setcmap(&umap, fb_info);
fb_copy_cmap(&umap, &fb_info->cmap);
fb_dealloc_cmap(&umap);

return rc ?: count;
}
for (i = 0; i < length; i++) {
u16 red, blue, green, tsp;

sscanf(&buf[i * 16 + 3], "%4hx", &red);
sscanf(&buf[i * 16 + 7], "%4hx", &blue);
sscanf(&buf[i * 16 + 11], "%4hx", &green);
tsp = (buf[i * 16 + 2] != ' ');
if ((rc = fb_info->fbops->fb_setcolreg(start++,
red, green, blue, tsp, fb_info)))
return rc;

fb_info->cmap.red[i] = red;
fb_info->cmap.blue[i] = blue;
fb_info->cmap.green[i] = green;
if (transp)
fb_info->cmap.transp[i] = tsp;
}
return count;
}

static ssize_t show_cmap(struct class_device *class_device, char *buf)
{
struct fb_info *fb_info = class_get_devdata(class_device);
unsigned int i;

if (!fb_info->cmap.red || !fb_info->cmap.blue ||
!fb_info->cmap.green)
return -EINVAL;

if (fb_info->cmap.len > PAGE_SIZE / 16)
return -EINVAL;

/* don't mess with the format, the buffer is PAGE_SIZE */
/* 256 entries at 16 chars per line equals 4096 = PAGE_SIZE */
for (i = 0; i < fb_info->cmap.len; i++) {
snprintf(&buf[ i * 16], PAGE_SIZE - i * 16, "%02x%c%4x%4x%4x\n", i + fb_info->cmap.start,
((fb_info->cmap.transp && fb_info->cmap.transp[i]) ? '*' : ' '),
fb_info->cmap.red[i], fb_info->cmap.blue[i],
fb_info->cmap.green[i]);
}
return 16 * fb_info->cmap.len;
}

static ssize_t store_blank(struct class_device *class_device, const char * buf,
size_t count)
{
Expand Down Expand Up @@ -502,10 +414,12 @@ static ssize_t show_fbstate(struct class_device *class_device, char *buf)
return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
}

/* When cmap is added back in it should be a binary attribute
* not a text one. Consideration should also be given to converting
* fbdev to use configfs instead of sysfs */
static struct class_device_attribute class_device_attrs[] = {
__ATTR(bits_per_pixel, S_IRUGO|S_IWUSR, show_bpp, store_bpp),
__ATTR(blank, S_IRUGO|S_IWUSR, show_blank, store_blank),
__ATTR(color_map, S_IRUGO|S_IWUSR, show_cmap, store_cmap),
__ATTR(console, S_IRUGO|S_IWUSR, show_console, store_console),
__ATTR(cursor, S_IRUGO|S_IWUSR, show_cursor, store_cursor),
__ATTR(mode, S_IRUGO|S_IWUSR, show_mode, store_mode),
Expand Down
5 changes: 2 additions & 3 deletions include/linux/debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode,
*/

static inline struct dentry *debugfs_create_file(const char *name, mode_t mode,
struct dentry *parent,
void *data,
struct file_operations *fops)
struct dentry *parent, void *data,
const struct file_operations *fops)
{
return ERR_PTR(-ENODEV);
}
Expand Down
3 changes: 1 addition & 2 deletions include/linux/kobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ struct subsys_attribute {
};

extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);

#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
#if defined(CONFIG_HOTPLUG)
void kobject_uevent(struct kobject *kobj, enum kobject_action action);

int add_uevent_var(char **envp, int num_envp, int *cur_index,
Expand Down
7 changes: 2 additions & 5 deletions lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name)

return k;
}
EXPORT_SYMBOL_GPL(kobject_add_dir);

/**
* kset_init - initialize a kset for use
Expand Down Expand Up @@ -569,14 +568,15 @@ int subsys_create_file(struct subsystem * s, struct subsys_attribute * a)
* @s: subsystem.
* @a: attribute desciptor.
*/

#if 0
void subsys_remove_file(struct subsystem * s, struct subsys_attribute * a)
{
if (subsys_get(s)) {
sysfs_remove_file(&s->kset.kobj,&a->attr);
subsys_put(s);
}
}
#endif /* 0 */

EXPORT_SYMBOL(kobject_init);
EXPORT_SYMBOL(kobject_register);
Expand All @@ -588,10 +588,7 @@ EXPORT_SYMBOL(kobject_del);

EXPORT_SYMBOL(kset_register);
EXPORT_SYMBOL(kset_unregister);
EXPORT_SYMBOL(kset_find_obj);

EXPORT_SYMBOL(subsystem_init);
EXPORT_SYMBOL(subsystem_register);
EXPORT_SYMBOL(subsystem_unregister);
EXPORT_SYMBOL(subsys_create_file);
EXPORT_SYMBOL(subsys_remove_file);
8 changes: 7 additions & 1 deletion lib/kobject_uevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
#define BUFFER_SIZE 2048 /* buffer for the variables */
#define NUM_ENVP 32 /* number of env pointers */

#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
#if defined(CONFIG_HOTPLUG)
u64 uevent_seqnum;
char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
static DEFINE_SPINLOCK(sequence_lock);
#if defined(CONFIG_NET)
static struct sock *uevent_sock;
#endif

static char *action_to_string(enum kobject_action action)
{
Expand Down Expand Up @@ -155,6 +157,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action)
spin_unlock(&sequence_lock);
sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);

#if defined(CONFIG_NET)
/* send netlink message */
if (uevent_sock) {
struct sk_buff *skb;
Expand All @@ -179,6 +182,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action)
netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
}
}
#endif

/* call uevent_helper, usually only enabled during early boot */
if (uevent_helper[0]) {
Expand Down Expand Up @@ -249,6 +253,7 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index,
}
EXPORT_SYMBOL_GPL(add_uevent_var);

#if defined(CONFIG_NET)
static int __init kobject_uevent_init(void)
{
uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL,
Expand All @@ -264,5 +269,6 @@ static int __init kobject_uevent_init(void)
}

postcore_initcall(kobject_uevent_init);
#endif

#endif /* CONFIG_HOTPLUG */

0 comments on commit 2cb1459

Please sign in to comment.