diff options
Diffstat (limited to 'drivers/platform/x86/intel')
4 files changed, 19 insertions, 14 deletions
| diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index 61dffb4c8a1d..e6ae8265f3a3 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev)  			continue;  		reinit_completion(&ifs_done);  		local_work.dev = dev; -		INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks); +		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);  		schedule_work_on(cpu, &local_work.w);  		wait_for_completion(&ifs_done);  		if (ifsd->loading_error) { diff --git a/drivers/platform/x86/intel/int3472/clk_and_regulator.c b/drivers/platform/x86/intel/int3472/clk_and_regulator.c index 1086c3d83494..399f0623ca1b 100644 --- a/drivers/platform/x86/intel/int3472/clk_and_regulator.c +++ b/drivers/platform/x86/intel/int3472/clk_and_regulator.c @@ -101,9 +101,11 @@ int skl_int3472_register_clock(struct int3472_discrete_device *int3472,  	int3472->clock.ena_gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0],  							     "int3472,clk-enable"); -	if (IS_ERR(int3472->clock.ena_gpio)) -		return dev_err_probe(int3472->dev, PTR_ERR(int3472->clock.ena_gpio), -				     "getting clk-enable GPIO\n"); +	if (IS_ERR(int3472->clock.ena_gpio)) { +		ret = PTR_ERR(int3472->clock.ena_gpio); +		int3472->clock.ena_gpio = NULL; +		return dev_err_probe(int3472->dev, ret, "getting clk-enable GPIO\n"); +	}  	if (polarity == GPIO_ACTIVE_LOW)  		gpiod_toggle_active_low(int3472->clock.ena_gpio); @@ -199,8 +201,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,  	int3472->regulator.gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0],  							     "int3472,regulator");  	if (IS_ERR(int3472->regulator.gpio)) { -		dev_err(int3472->dev, "Failed to get regulator GPIO line\n"); -		return PTR_ERR(int3472->regulator.gpio); +		ret = PTR_ERR(int3472->regulator.gpio); +		int3472->regulator.gpio = NULL; +		return dev_err_probe(int3472->dev, ret, "getting regulator GPIO\n");  	}  	/* Ensure the pin is in output mode and non-active state */ diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c index e0572a29212e..02fe360a59c7 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -304,14 +304,13 @@ struct isst_if_pkg_info {  static struct isst_if_cpu_info *isst_cpu_info;  static struct isst_if_pkg_info *isst_pkg_info; -#define ISST_MAX_PCI_DOMAINS	8 -  static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn)  {  	struct pci_dev *matched_pci_dev = NULL;  	struct pci_dev *pci_dev = NULL; +	struct pci_dev *_pci_dev = NULL;  	int no_matches = 0, pkg_id; -	int i, bus_number; +	int bus_number;  	if (bus_no < 0 || bus_no >= ISST_MAX_BUS_NUMBER || cpu < 0 ||  	    cpu >= nr_cpu_ids || cpu >= num_possible_cpus()) @@ -323,12 +322,11 @@ static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn  	if (bus_number < 0)  		return NULL; -	for (i = 0; i < ISST_MAX_PCI_DOMAINS; ++i) { -		struct pci_dev *_pci_dev; +	for_each_pci_dev(_pci_dev) {  		int node; -		_pci_dev = pci_get_domain_bus_and_slot(i, bus_number, PCI_DEVFN(dev, fn)); -		if (!_pci_dev) +		if (_pci_dev->bus->number != bus_number || +		    _pci_dev->devfn != PCI_DEVFN(dev, fn))  			continue;  		++no_matches; diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c index 1a300e14f350..064f186ae81b 100644 --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c @@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data,  				      int min_max)  {  	unsigned int input; +	int ret;  	if (kstrtouint(buf, 10, &input))  		return -EINVAL;  	mutex_lock(&uncore_lock); -	uncore_write(data, input, min_max); +	ret = uncore_write(data, input, min_max);  	mutex_unlock(&uncore_lock); +	if (ret) +		return ret; +  	return count;  } |