[PATCH] mtd: intel-spi: add is_protected and is_bios_locked knobs

Joe Perches joe at perches.com
Tue Mar 30 19:12:43 BST 2021


On Tue, 2021-03-30 at 18:54 +0300, Tomas Winkler wrote:
> From: Tamar Mashiah <tamar.mashiah at intel.com>
[]
> the region protection status is exposed via sysfs file
> as the manufacturing will need the both files in order to validate
> that the device is properly sealed.
[]
> diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
[]
> +static ssize_t intel_spi_is_protected_show(struct device *dev,
> +					   struct device_attribute *attr, char *buf)
> +{
> +	struct intel_spi *ispi = dev_get_drvdata(dev);
> +
> +	return sysfs_emit(buf, "%d", ispi->is_protected);

These should also include a newline in the format.  i.e.:

	return sysfs_emit(buf, "%d\n", ispi->is_protected);


> +static ssize_t intel_spi_bios_lock_show(struct device *dev,
> +					struct device_attribute *attr, char *buf)
> +{
> +	struct intel_spi *ispi = dev_get_drvdata(dev);
> +
> +	return sysfs_emit(buf, "%d", ispi->is_bios_locked);

etc...





More information about the linux-mtd mailing list