mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
cdd30ebb1b
Clean up the existing export namespace code along the same lines of
commit 33def8498f
("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
77 lines
1.8 KiB
C
77 lines
1.8 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* STMicroelectronics hts221 i2c driver
|
|
*
|
|
* Copyright 2016 STMicroelectronics Inc.
|
|
*
|
|
* Lorenzo Bianconi <lorenzo.bianconi@st.com>
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
#include <linux/mod_devicetable.h>
|
|
#include <linux/i2c.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/regmap.h>
|
|
|
|
#include "hts221.h"
|
|
|
|
#define HTS221_I2C_AUTO_INCREMENT BIT(7)
|
|
|
|
static const struct regmap_config hts221_i2c_regmap_config = {
|
|
.reg_bits = 8,
|
|
.val_bits = 8,
|
|
.write_flag_mask = HTS221_I2C_AUTO_INCREMENT,
|
|
.read_flag_mask = HTS221_I2C_AUTO_INCREMENT,
|
|
};
|
|
|
|
static int hts221_i2c_probe(struct i2c_client *client)
|
|
{
|
|
struct regmap *regmap;
|
|
|
|
regmap = devm_regmap_init_i2c(client, &hts221_i2c_regmap_config);
|
|
if (IS_ERR(regmap)) {
|
|
dev_err(&client->dev, "Failed to register i2c regmap %ld\n",
|
|
PTR_ERR(regmap));
|
|
return PTR_ERR(regmap);
|
|
}
|
|
|
|
return hts221_probe(&client->dev, client->irq,
|
|
client->name, regmap);
|
|
}
|
|
|
|
static const struct acpi_device_id hts221_acpi_match[] = {
|
|
{"SMO9100", 0},
|
|
{ },
|
|
};
|
|
MODULE_DEVICE_TABLE(acpi, hts221_acpi_match);
|
|
|
|
static const struct of_device_id hts221_i2c_of_match[] = {
|
|
{ .compatible = "st,hts221", },
|
|
{},
|
|
};
|
|
MODULE_DEVICE_TABLE(of, hts221_i2c_of_match);
|
|
|
|
static const struct i2c_device_id hts221_i2c_id_table[] = {
|
|
{ HTS221_DEV_NAME },
|
|
{},
|
|
};
|
|
MODULE_DEVICE_TABLE(i2c, hts221_i2c_id_table);
|
|
|
|
static struct i2c_driver hts221_driver = {
|
|
.driver = {
|
|
.name = "hts221_i2c",
|
|
.pm = pm_sleep_ptr(&hts221_pm_ops),
|
|
.of_match_table = hts221_i2c_of_match,
|
|
.acpi_match_table = hts221_acpi_match,
|
|
},
|
|
.probe = hts221_i2c_probe,
|
|
.id_table = hts221_i2c_id_table,
|
|
};
|
|
module_i2c_driver(hts221_driver);
|
|
|
|
MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@st.com>");
|
|
MODULE_DESCRIPTION("STMicroelectronics hts221 i2c driver");
|
|
MODULE_LICENSE("GPL v2");
|
|
MODULE_IMPORT_NS("IIO_HTS221");
|