kernel-fxtec-pro1x/drivers/base/firmware.c
Greg Kroah-Hartman 3514faca19 kobject: remove struct kobj_type from struct kset
We don't need a "default" ktype for a kset.  We should set this
explicitly every time for each kset.  This change is needed so that we
can make ksets dynamic, and cleans up one of the odd, undocumented
assumption that the kset/kobject/ktype model has.

This patch is based on a lot of help from Kay Sievers.

Nasty bug in the block code was found by Dave Young
<hidave.darkstar@gmail.com>

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24 20:40:10 -08:00

38 lines
716 B
C

/*
* firmware.c - firmware subsystem hoohaw.
*
* Copyright (c) 2002-3 Patrick Mochel
* Copyright (c) 2002-3 Open Source Development Labs
*
* This file is released under the GPLv2
*
*/
#include <linux/kobject.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include "base.h"
static decl_subsys(firmware, NULL);
int firmware_register(struct kset *s)
{
s->kobj.kset = &firmware_subsys;
s->kobj.ktype = NULL;
return subsystem_register(s);
}
void firmware_unregister(struct kset *s)
{
subsystem_unregister(s);
}
int __init firmware_init(void)
{
return subsystem_register(&firmware_subsys);
}
EXPORT_SYMBOL_GPL(firmware_register);
EXPORT_SYMBOL_GPL(firmware_unregister);