cs35l45-spi.c (6085f9e6dc1973cf98ee7f5dcf629939e50f1b84) | cs35l45-spi.c (74b14e2850a34740c121cf2758d4181063d4c77c) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2// 3// cs35l45-spi.c -- CS35L45 SPI driver 4// 5// Copyright 2019-2022 Cirrus Logic, Inc. 6// 7// Author: James Schulman <james.schulman@cirrus.com> 8 --- 9 unchanged lines hidden (view full) --- 18 struct cs35l45_private *cs35l45; 19 struct device *dev = &spi->dev; 20 int ret; 21 22 cs35l45 = devm_kzalloc(dev, sizeof(struct cs35l45_private), GFP_KERNEL); 23 if (cs35l45 == NULL) 24 return -ENOMEM; 25 | 1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2// 3// cs35l45-spi.c -- CS35L45 SPI driver 4// 5// Copyright 2019-2022 Cirrus Logic, Inc. 6// 7// Author: James Schulman <james.schulman@cirrus.com> 8 --- 9 unchanged lines hidden (view full) --- 18 struct cs35l45_private *cs35l45; 19 struct device *dev = &spi->dev; 20 int ret; 21 22 cs35l45 = devm_kzalloc(dev, sizeof(struct cs35l45_private), GFP_KERNEL); 23 if (cs35l45 == NULL) 24 return -ENOMEM; 25 |
26 spi->max_speed_hz = CS35L45_SPI_MAX_FREQ; 27 spi_setup(spi); 28 |
|
26 spi_set_drvdata(spi, cs35l45); 27 cs35l45->regmap = devm_regmap_init_spi(spi, &cs35l45_spi_regmap); 28 if (IS_ERR(cs35l45->regmap)) { 29 ret = PTR_ERR(cs35l45->regmap); 30 dev_err(dev, "Failed to allocate register map: %d\n", ret); 31 return ret; 32 } 33 --- 41 unchanged lines hidden --- | 29 spi_set_drvdata(spi, cs35l45); 30 cs35l45->regmap = devm_regmap_init_spi(spi, &cs35l45_spi_regmap); 31 if (IS_ERR(cs35l45->regmap)) { 32 ret = PTR_ERR(cs35l45->regmap); 33 dev_err(dev, "Failed to allocate register map: %d\n", ret); 34 return ret; 35 } 36 --- 41 unchanged lines hidden --- |