Skip to content
Snippets Groups Projects
Select Git revision
  • 13731de6add8a543b1fc9ea292197d81a517ef9e
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

core.c

Blame
  • core.c 51.81 KiB
    /*
     * drivers/base/core.c - core driver model code (device registration, etc)
     *
     * Copyright (c) 2002-3 Patrick Mochel
     * Copyright (c) 2002-3 Open Source Development Labs
     * Copyright (c) 2006 Greg Kroah-Hartman <gregkh@suse.de>
     * Copyright (c) 2006 Novell, Inc.
     *
     * This file is released under the GPLv2
     *
     */
    
    #include <linux/device.h>
    #include <linux/err.h>
    #include <linux/init.h>
    #include <linux/module.h>
    #include <linux/slab.h>
    #include <linux/string.h>
    #include <linux/kdev_t.h>
    #include <linux/notifier.h>
    #include <linux/of.h>
    #include <linux/of_device.h>
    #include <linux/genhd.h>
    #include <linux/kallsyms.h>
    #include <linux/mutex.h>
    #include <linux/async.h>
    #include <linux/pm_runtime.h>
    #include <linux/netdevice.h>
    
    #include "base.h"
    #include "power/power.h"
    
    #ifdef CONFIG_SYSFS_DEPRECATED
    #ifdef CONFIG_SYSFS_DEPRECATED_V2
    long sysfs_deprecated = 1;
    #else
    long sysfs_deprecated = 0;
    #endif
    static __init int sysfs_deprecated_setup(char *arg)
    {
    	return strict_strtol(arg, 10, &sysfs_deprecated);
    }
    early_param("sysfs.deprecated", sysfs_deprecated_setup);
    #endif
    
    int (*platform_notify)(struct device *dev) = NULL;
    int (*platform_notify_remove)(struct device *dev) = NULL;
    static struct kobject *dev_kobj;
    struct kobject *sysfs_dev_char_kobj;
    struct kobject *sysfs_dev_block_kobj;
    
    #ifdef CONFIG_BLOCK
    static inline int device_is_not_partition(struct device *dev)
    {
    	return !(dev->type == &part_type);
    }
    #else
    static inline int device_is_not_partition(struct device *dev)
    {
    	return 1;
    }
    #endif
    
    /**
     * dev_driver_string - Return a device's driver name, if at all possible
     * @dev: struct device to get the name of
     *
     * Will return the device's driver's name if it is bound to a device.  If
     * the device is not bound to a driver, it will return the name of the bus
     * it is attached to.  If it is not attached to a bus either, an empty